Skip to content

Commit 0444f3d

Browse files
authored
Move isort, pylint, and pytest configs to pyproject.toml (home-assistant#40335)
1 parent ed9a408 commit 0444f3d

File tree

3 files changed

+114
-79
lines changed

3 files changed

+114
-79
lines changed

pylintrc

-65
This file was deleted.

pyproject.toml

+114
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,117 @@
11
[tool.black]
22
target-version = ["py37", "py38"]
33
exclude = 'generated'
4+
5+
[tool.isort]
6+
# https://github.com/PyCQA/isort/wiki/isort-Settings
7+
profile = "black"
8+
# will group `import x` and `from x import` of the same module.
9+
force_sort_within_sections = true
10+
known_first_party = [
11+
"homeassistant",
12+
"tests",
13+
]
14+
forced_separate = [
15+
"tests",
16+
]
17+
combine_as_imports = true
18+
19+
[tool.pylint.MASTER]
20+
ignore = [
21+
"tests",
22+
]
23+
# Use a conservative default here; 2 should speed up most setups and not hurt
24+
# any too bad. Override on command line as appropriate.
25+
# Disabled for now: https://github.com/PyCQA/pylint/issues/3584
26+
#jobs = 2
27+
load-plugins = [
28+
"pylint_strict_informational",
29+
]
30+
persistent = false
31+
extension-pkg-whitelist = [
32+
"ciso8601",
33+
"cv2",
34+
]
35+
36+
[tool.pylint.BASIC]
37+
good-names = [
38+
"_",
39+
"ev",
40+
"ex",
41+
"fp",
42+
"i",
43+
"id",
44+
"j",
45+
"k",
46+
"Run",
47+
"T",
48+
]
49+
50+
[tool.pylint."MESSAGES CONTROL"]
51+
# Reasons disabled:
52+
# format - handled by black
53+
# locally-disabled - it spams too much
54+
# duplicate-code - unavoidable
55+
# cyclic-import - doesn't test if both import on load
56+
# abstract-class-little-used - prevents from setting right foundation
57+
# unused-argument - generic callbacks and setup methods create a lot of warnings
58+
# too-many-* - are not enforced for the sake of readability
59+
# too-few-* - same as too-many-*
60+
# abstract-method - with intro of async there are always methods missing
61+
# inconsistent-return-statements - doesn't handle raise
62+
# too-many-ancestors - it's too strict.
63+
# wrong-import-order - isort guards this
64+
disable = [
65+
"format",
66+
"abstract-class-little-used",
67+
"abstract-method",
68+
"cyclic-import",
69+
"duplicate-code",
70+
"inconsistent-return-statements",
71+
"locally-disabled",
72+
"not-context-manager",
73+
"too-few-public-methods",
74+
"too-many-ancestors",
75+
"too-many-arguments",
76+
"too-many-branches",
77+
"too-many-instance-attributes",
78+
"too-many-lines",
79+
"too-many-locals",
80+
"too-many-public-methods",
81+
"too-many-return-statements",
82+
"too-many-statements",
83+
"too-many-boolean-expressions",
84+
"unused-argument",
85+
"wrong-import-order",
86+
]
87+
enable = [
88+
#"useless-suppression", # temporarily every now and then to clean them up
89+
"use-symbolic-message-instead",
90+
]
91+
92+
[tool.pylint.REPORTS]
93+
score = false
94+
95+
[tool.pylint.TYPECHECK]
96+
ignored-classes = [
97+
"_CountingAttr", # for attrs
98+
]
99+
100+
[tool.pylint.FORMAT]
101+
expected-line-ending-format = "LF"
102+
103+
[tool.pylint.EXCEPTIONS]
104+
overgeneral-exceptions = [
105+
"BaseException",
106+
"Exception",
107+
"HomeAssistantError",
108+
]
109+
110+
[tool.pytest.ini_options]
111+
testpaths = [
112+
"tests",
113+
]
114+
norecursedirs = [
115+
".git",
116+
"testing_config",
117+
]

setup.cfg

-14
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ classifier =
1414
Programming Language :: Python :: 3.7
1515
Topic :: Home Automation
1616

17-
[tool:pytest]
18-
testpaths = tests
19-
norecursedirs = .git testing_config
20-
2117
[flake8]
2218
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
2319
doctests = True
@@ -35,16 +31,6 @@ ignore =
3531
D202,
3632
W504
3733

38-
[isort]
39-
# https://github.com/timothycrosley/isort
40-
# https://github.com/timothycrosley/isort/wiki/isort-Settings
41-
profile = black
42-
# will group `import x` and `from x import` of the same module.
43-
force_sort_within_sections = true
44-
known_first_party = homeassistant,tests
45-
forced_separate = tests
46-
combine_as_imports = true
47-
4834
[mypy]
4935
python_version = 3.7
5036
ignore_errors = true

0 commit comments

Comments
 (0)