-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Konstantin Deev
committed
Aug 17, 2023
1 parent
9cab5c8
commit 739db11
Showing
6 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: pre-commit | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/action@v3.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: ["--fix=lf"] | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.0.280 | ||
hooks: | ||
- id: ruff | ||
args: ["--fix"] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[tool.black] | ||
target-version = ["py39", "py310"] | ||
exclude = 'generated' | ||
|
||
[tool.isort] | ||
# https://github.com/PyCQA/isort/wiki/isort-Settings | ||
profile = "black" | ||
# will group `import x` and `from x import` of the same module. | ||
force_sort_within_sections = true | ||
known_first_party = [ | ||
"homeassistant", | ||
"tests", | ||
] | ||
forced_separate = [ | ||
"tests", | ||
] | ||
combine_as_imports = true | ||
|
||
[flake8] | ||
; ignore = E211, E999, F401, F821, W503 | ||
max-doc-length = 72 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml | ||
|
||
target-version = "py310" | ||
|
||
select = ["ALL"] | ||
|
||
# All the ones without a comment were the ones that are currently violated | ||
# by the codebase. The plan is to fix them all (when sensible) and then enable them. | ||
ignore = [ | ||
"ANN", | ||
"ANN101", # Missing type annotation for {name} in method | ||
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name} | ||
"D401", # First line of docstring should be in imperative mood | ||
"E501", # line too long | ||
"FBT001", # Boolean positional arg in function definition | ||
"FBT002", # Boolean default value in function definition | ||
"FIX004", # Line contains HACK, consider resolving the issue | ||
"PD901", # df is a bad variable name. Be kinder to your future self. | ||
"PERF203",# `try`-`except` within a loop incurs performance overhead | ||
"PLR0913", # Too many arguments to function call (N > 5) | ||
"PLR2004", # Magic value used in comparison, consider replacing X with a constant variable | ||
"S101", # Use of assert detected | ||
"SLF001", # Private member accessed | ||
] | ||
|
||
[per-file-ignores] | ||
"tests/*.py" = ["ALL"] | ||
".github/*py" = ["INP001"] | ||
|
||
[flake8-pytest-style] | ||
fixture-parentheses = false | ||
|
||
[pyupgrade] | ||
keep-runtime-typing = true | ||
|
||
[mccabe] | ||
max-complexity = 25 |