Skip to content

Commit e9c160e

Browse files
authored
Merge pull request #79 from ogajduse/feat/add-pre-commit
2 parents 5cf6ac7 + 2e25cd5 commit e9c160e

File tree

14 files changed

+297
-64
lines changed

14 files changed

+297
-64
lines changed

β€Ž.github/dependabot.ymlβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This is the configuration file for Dependabot. You can find configuration information below.
2+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
# Note: Dependabot has a configurable max open PR limit of 5
4+
5+
version: 2
6+
updates:
7+
# Maintain dependencies for our GitHub Actions
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
labels:
13+
- "dependencies"
14+
- package-ecosystem: "pip"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
labels:
19+
- "dependencies"

β€Ž.github/workflows/hacs.yamlβ€Ž

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: HACS Action
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
9+
jobs:
10+
hacs:
11+
name: HACS Action
12+
runs-on: "ubuntu-latest"
13+
steps:
14+
- name: HACS Action
15+
uses: "hacs/action@main"
16+
with:
17+
category: "integration"
18+
ignore: "brands"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI/CQ
2+
3+
on:
4+
pull_request:
5+
types: ["opened", "synchronize", "reopened"]
6+
7+
jobs:
8+
codechecks:
9+
name: Code Quality
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.11"]
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set Up Python-${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Pre Commit Checks
24+
uses: pre-commit/[email protected]
25+
26+
- name: Install Dependencies
27+
run: pip install .[dev]
28+
29+
- name: Analysis (git diff)
30+
if: failure()
31+
run: git diff

β€Ž.gitignoreβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Compiled python code.
2+
*.pyc
3+
build/
4+
*.egg-info/

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# configuration for pre-commit git hooks
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: debug-statements
11+
- repo: https://github.com/asottile/pyupgrade
12+
rev: v3.3.0
13+
hooks:
14+
- id: pyupgrade
15+
args: [--py311-plus]
16+
- repo: https://github.com/psf/black
17+
rev: "22.10.0"
18+
hooks:
19+
- id: black
20+
- repo: https://github.com/pre-commit/mirrors-mypy
21+
rev: "v1.4.1"
22+
hooks:
23+
- id: mypy
24+
additional_dependencies: [homeassistant-stubs, voluptuous-stubs, types-python-dateutil]
25+
- repo: https://github.com/astral-sh/ruff-pre-commit
26+
# Ruff version.
27+
rev: v0.0.278
28+
hooks:
29+
- id: ruff
30+
args: [--fix, --exit-non-zero-on-fix]

β€Ž.vscode/settings.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"python.formatting.provider": "black"
3-
}
3+
}

β€ŽLICENSEβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Init file for custom_components."""

β€Žcustom_components/feedparser/__init__.pyβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
A component which allows you to parse an RSS feed into a sensor
1+
"""A component which allows you to parse an RSS feed into a sensor.
32
43
For more details about this component, please refer to the documentation at
54
https://github.com/custom-components/sensor.feedparser

0 commit comments

Comments
Β (0)