-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade test and lint environment (#876)
* upgrade pre-commit hook versions and black target-version * use pytest asyncio_mode auto and move options to pyproject.toml * move isort config to pyproject.toml and treat xknx as first party - except for /home-assistant-plugin which gets its own .isort.cfg * move mypy config to pyproject.toml * move pylint config to pyproject.toml and enable `useless-suppression` * Update pyproject.toml
- Loading branch information
Showing
112 changed files
with
222 additions
and
240 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
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
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
|
||
# import time | ||
import paho.mqtt.client as mqtt | ||
|
||
from xknx import XKNX | ||
from xknx.devices import Sensor | ||
|
||
|
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,8 @@ | ||
[settings] | ||
profile = black | ||
# will group `import x` and `from x import` of the same module. | ||
force_sort_within_sections = true | ||
known_third_party = xknx | ||
known_first_party = homeassistant,test | ||
forced_separate = test | ||
combine_as_imports = true |
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
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 |
---|---|---|
@@ -1,3 +1,83 @@ | ||
[tool.black] | ||
target-version = ["py38"] | ||
target-version = ["py39", "py310"] | ||
exclude = "generated" | ||
|
||
[tool.isort] | ||
profile = "black" | ||
# will group `import x` and `from x import` of the same module. | ||
force_sort_within_sections = true | ||
combine_as_imports = true | ||
|
||
[tool.mypy] | ||
python_version = "3.9" | ||
strict = true | ||
ignore_missing_imports = true | ||
implicit_reexport = true | ||
warn_unreachable = true | ||
|
||
[tool.pylint.master] | ||
ignore = "test" | ||
persistent = "no" | ||
reports = "no" | ||
extension-pkg-whitelist = "netifaces" | ||
|
||
[tool.pylint.message_control] | ||
# Reasons disabled: | ||
# format - handled by black | ||
# locally-disabled - it spams too much | ||
# duplicate-code - unavoidable | ||
# cyclic-import - doesn't test if both import on load | ||
# abstract-class-little-used - prevents from setting right foundation | ||
# unused-argument - generic callbacks and setup methods create a lot of warnings | ||
# raise-missing-from - we use this in order to avoid too generic exception to the user | ||
# too-many-* - are not enforced for the sake of readability | ||
# too-few-* - same as too-many-* | ||
# abstract-method - with intro of async there are always methods missing | ||
# inconsistent-return-statements - doesn't handle raise | ||
# too-many-ancestors - it's too strict. | ||
# wrong-import-order - isort guards this | ||
# fixme - TODO | ||
disable = [ | ||
"format", | ||
"abstract-class-little-used", | ||
"abstract-method", | ||
"cyclic-import", | ||
"duplicate-code", | ||
"fixme", | ||
"inconsistent-return-statements", | ||
"locally-disabled", | ||
"not-context-manager", | ||
"raise-missing-from", | ||
"too-few-public-methods", | ||
"too-many-ancestors", | ||
"too-many-arguments", | ||
"too-many-branches", | ||
"too-many-instance-attributes", | ||
"too-many-lines", | ||
"too-many-locals", | ||
"too-many-public-methods", | ||
"too-many-return-statements", | ||
"too-many-statements", | ||
"too-many-boolean-expressions", | ||
"unused-argument", | ||
"wrong-import-order", | ||
] | ||
# disabled for tests via command line options in Makefile: | ||
# - no-self-use | ||
# - protected-access | ||
# - abstract-class-instantiated | ||
enable = [ | ||
"use-symbolic-message-instead", | ||
] | ||
|
||
[tool.pylint.format] | ||
expected-line-ending-format = "LF" | ||
|
||
[tool.pylint.reports] | ||
score = "no" | ||
output-format = "colorized" | ||
|
||
|
||
[tool.pytest.ini_options] | ||
testpaths = "test" | ||
asyncio_mode = "auto" |
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 |
---|---|---|
@@ -1,40 +1,18 @@ | ||
[metadata] | ||
description-file = README.md | ||
|
||
[tool:pytest] | ||
testpaths = test | ||
norecursedirs = .git | ||
|
||
[flake8] | ||
exclude = .venv,.git,.tox,bin,lib,deps,build | ||
# black requires this | ||
max-line-length = 88 | ||
# D202 No blank lines allowed after function docstring | ||
# E203: Whitespace before ':' | ||
# 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 = | ||
D202, | ||
E203, | ||
E501, | ||
W503, | ||
E203, | ||
D202, | ||
W504 | ||
|
||
[isort] | ||
# https://github.com/timothycrosley/isort | ||
# https://github.com/timothycrosley/isort/wiki/isort-Settings | ||
profile = black | ||
# will group `import x` and `from x import` of the same module. | ||
force_sort_within_sections = true | ||
known_third_party = xknx | ||
known_first_party = homeassistant,test | ||
forced_separate = test | ||
combine_as_imports = true | ||
|
||
[mypy] | ||
python_version = 3.9 | ||
strict = true | ||
warn_unreachable = true | ||
implicit_reexport = true | ||
ignore_missing_imports = true |
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
Oops, something went wrong.