-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
pyproject.toml
119 lines (88 loc) · 3.46 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
### project ##########################################################################
# last checked/updated: 2024-09-10
#
#
### pytest ###########################################################################
[tool.pytest.ini_options]
asyncio_mode = "auto"
#
### mypy ############################################################################
[tool.mypy]
files = [
"custom_components"
]
exclude = "tests/virtual_rf/*"
follow_imports = "skip" # TODO: don't use this feature
# no_implicit_optional = false
# see: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options
# Start off with these
warn_unused_configs = true
warn_redundant_casts = true # this is not per-module
warn_unused_ignores = true
# Getting these passing should be easy
extra_checks = true # now incl.: strict_concatenate = true
strict_equality = true
# Strongly recommend enabling this one as soon as you can
check_untyped_defs = true
# These shouldn't be too much additional work, but may be tricky to
# get passing if you use a lot of untyped libraries
# disallow_subclassing_any = true # excl. for HA
# disallow_untyped_decorators = true # excl. for HA
disallow_any_generics = true
# These next few are various gradations of forcing use of type annotations
disallow_untyped_calls = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
# This one isn't too hard to get passing, but return on investment is lower
no_implicit_reexport = true
# This one can be tricky to get passing if you use a lot of untyped libraries
# warn_return_any = true # excl. for HA: lots of decorators
# disallow_any_unimported = true
warn_no_return = true
warn_unreachable = true
[[tool.mypy.overrides]]
module = ["homeassistant.*", "ramses_rf.*"]
ignore_missing_imports = true
#
## ruff ##############################################################################
[tool.ruff]
# exclude = ["tests/deprecated/*.py"]
src = ["custom_components"]
target-version = "py312"
[tool.ruff.lint]
select = [
"ASYNC", # flake8-async
"B", # flake8-bugbear
"E", # pycodestyle
"F", # Pyflakes
"I", # isort
"SIM", # flake8-simplify
"UP", # pyupgrade
]
ignore = ["ASYNC109", "E501", "SIM102", "SIM114"]
# E501 - Line too long
# SIM102 - Use a single `if` statement instead of nested `if` statements
# SIM114 - Combine `if` branches using logical `or` operator
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
voluptuous = "vol"
"homeassistant.helpers.area_registry" = "ar"
"homeassistant.helpers.config_validation" = "cv"
"homeassistant.helpers.device_registry" = "dr"
"homeassistant.helpers.entity_registry" = "er"
"homeassistant.helpers.issue_registry" = "ir"
"homeassistant.util.dt" = "dt_util"
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"async_timeout".msg = "use asyncio.timeout instead"
"pytz".msg = "use zoneinfo instead"
[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = false
known-first-party = ["custom_components", "ramses_rf", "ramses_tx"]
split-on-trailing-comma = false
[tool.ruff.lint.mccabe]
max-complexity = 25
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ASYNC"]