-
Notifications
You must be signed in to change notification settings - Fork 43
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
Showing
7 changed files
with
156 additions
and
16 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 |
---|---|---|
|
@@ -4,3 +4,5 @@ custom_components/*/__pycache__/ | |
venv | ||
*.pyc | ||
.coverage | ||
coverage.xml | ||
.tox/py312/.tox-info.json |
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,50 @@ | ||
[MASTER] | ||
ignore=tests | ||
# Use a conservative default here; 2 should speed up most setups and not hurt | ||
# any too bad. Override on command line as appropriate. | ||
jobs=2 | ||
persistent=no | ||
|
||
[BASIC] | ||
good-names=id,i,j,k,ex,Run,_,fp | ||
max-attributes=15 | ||
argument-naming-style=snake_case | ||
attr-naming-style=snake_case | ||
|
||
[MESSAGES CONTROL] | ||
# Reasons disabled: | ||
# locally-disabled - it spams too much | ||
# too-many-* - are not enforced for the sake of readability | ||
# too-few-* - same as too-many-* | ||
# import-outside-toplevel - TODO | ||
disable= | ||
duplicate-code, | ||
fixme, | ||
import-outside-toplevel, | ||
locally-disabled, | ||
too-few-public-methods, | ||
too-many-arguments, | ||
too-many-public-methods, | ||
too-many-instance-attributes, | ||
too-many-branches, | ||
too-many-statements, | ||
broad-except, | ||
too-many-lines, | ||
too-many-locals, | ||
unexpected-keyword-arg, | ||
abstract-method, | ||
|
||
[REFACTORING] | ||
|
||
# Maximum number of nested blocks for function / method body | ||
max-nested-blocks=8 | ||
|
||
[REPORTS] | ||
score=no | ||
|
||
[TYPECHECK] | ||
# For attrs | ||
ignored-classes=_CountingAttr | ||
|
||
[FORMAT] | ||
expected-line-ending-format=LF |
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 |
---|---|---|
|
@@ -7,3 +7,6 @@ black | |
isort | ||
pydispatcher | ||
zeroconf | ||
tox | ||
mypy | ||
flake8 |
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,32 @@ | ||
[mypy] | ||
python_version = 3.10 | ||
show_error_codes = true | ||
ignore_errors = true | ||
follow_imports = silent | ||
ignore_missing_imports = true | ||
warn_incomplete_stub = true | ||
warn_redundant_casts = true | ||
warn_unused_configs = true | ||
|
||
[flake8] | ||
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build | ||
# To work with Black | ||
max-line-length = 88 | ||
# E501: line too long | ||
# W503: Line break occurred before a binary operator | ||
# E203: Whitespace before ':' | ||
# D202 No blank lines allowed after function docstring | ||
# W504 line break after binary operator | ||
ignore = | ||
E501, | ||
W503, | ||
E203, | ||
D202, | ||
W504 | ||
|
||
[isort] | ||
multi_line_output = 3 | ||
include_trailing_comma = True | ||
force_grid_wrap = 0 | ||
use_parentheses = True | ||
line_length = 88 |
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,35 @@ | ||
[tox] | ||
skipsdist = true | ||
envlist = py310, py311, py312, lint, mypy | ||
skip_missing_interpreters = True | ||
|
||
[gh-actions] | ||
python = | ||
3.10: py310 | ||
3.11: py311 | ||
3.12: py312, lint, mypy | ||
|
||
[testenv] | ||
commands = | ||
pytest --asyncio-mode=auto --timeout=30 --cov=custom_components/keymaster --cov-report=xml {posargs} | ||
deps = | ||
-rrequirements_test.txt | ||
|
||
[testenv:lint] | ||
basepython = python3 | ||
ignore_errors = True | ||
commands = | ||
black --check ./ | ||
flake8 custom_components/keymaster | ||
pylint custom_components/keymaster | ||
pydocstyle custom_components/keymaster tests | ||
deps = | ||
-rrequirements_test.txt | ||
|
||
[testenv:mypy] | ||
basepython = python3 | ||
ignore_errors = True | ||
commands = | ||
mypy custom_components/keymaster | ||
deps = | ||
-rrequirements_test.txt |