generated from ludeeus/integration_blueprint
-
-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathpyproject.toml
More file actions
175 lines (154 loc) · 5.59 KB
/
pyproject.toml
File metadata and controls
175 lines (154 loc) · 5.59 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
[project]
name = "ha-battery-notes"
version = "0.0.0"
description = "HA-Battery-Notes - A Home Assistant integration to provide battery notes of devices"
authors = [{ email = "Andrew Jackson <andrew@codechimp.org>" }]
maintainers = [{ email = "Andrew Jackson <andrew@codechimp.org>" }]
readme = "README.md"
license = "MIT"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3",
]
requires-python = "==3.13.2"
dependencies = [] # Use dev for all dependencies
[project.urls]
documentation = "https://github.com/andrew-codechimp/HA-Battery-Notes"
homepage = "https://github.com/andrew-codechimp/HA-Battery-Notes"
repository = "https://github.com/andrew-codechimp/HA-Battery-Notes"
"Bug Tracker" = "https://github.com/andrew-codechimp/HA-Battery-Notes/issues"
Changelog = "https://github.com/andrew-codechimp/HA-Battery-Notes/releases"
[dependency-groups]
dev = [
"colorlog",
"homeassistant==2025.12.0",
"mypy",
"pycares<5.0.0",
"ruff",
]
docs = [
"mkdocs-material",
]
library = [
"pytablewriter==0.61.0",
]
[tool.uv]
default-groups = ["dev"]
[tool.ruff]
target-version = "py313"
src = ["custom_components/battery_notes"]
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
line-ending = "auto"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Annotation and type hint rules
"ANN401", # Disallowing dynamically typed expressions (too strict)
# Docstring convention conflicts
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D404", # First word of the docstring should not be "This"
"D406", # Section name should end with a newline
"D407", # Section name underlining
"D411", # Missing blank line before section
# Style/tidiness adjustments
"TID252", # Relative imports
"E731", # Do not assign a lambda expression, use a def
# Formatting conflicts (black/ruff fmt)
"COM812",
"COM819",
"D206",
"E501", # Line too long (handled by formatter)
"ISC001",
"Q000",
"Q001",
"Q002",
"Q003",
"W191",
"RUF012", # Broken rule in some cases
# GitHub actions
"INP001", # File is part of an implicit namespace package
# Project preference
"ERA001", # Found commented-out code
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean-typed positional argument in function definition
"RUF001", # String contains ambiguous character
"S101", # Use of assert detected
"TC001", # Move application import into type checking
"TC006", # Add quotes to type expression in typing.cast()
"TD002", # Missing auther in TODO
"TD003", # Missing issue link TODO
"TRY400", # Use `logging.exception` instead of `logging.error`
# TODO: Temporary ignores, to review
"ANN001", # Missing type annotation for function argument
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"ANN204", # Missing return type annotation for special method
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"PLR2004", # Magic value used in comparison
"PTH103", # `os.makedirs()` should be replaced by `Path.mkdir()`
"PTH104", # `os.rename()` should be replaced by `Path.rename()`
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator
"PTH120", # `os.path.dirname()` should be replaced by `Path.parent`
"PTH123", # `open()` should be replaced by `Path.open()`
"PYI041", # Use `float` instead of `int | float`
"RET504", # Unnecessary assignment before `return` statement
"RET505", # Unnecessary `else` after `return` statement
"SIM102", # Use a single `if`-statement instead of nested `if`-statements
"TC003", # Move standard library import into a type-checking block
"TRY003", # Avoid specifying long messages outside the exception class
"TRY004", # Prefer `TypeError` exception for invalid type
"TRY300", # Consider moving this statement to an `else` block
]
[tool.ruff.lint.mccabe]
max-complexity = 25
[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
known-first-party = ["homeassistant"]
combine-as-imports = true
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"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"
voluptuous = "vol"
[tool.mypy]
# Specify the target platform details in config, so your developers are
# free to run mypy on Windows, Linux, or macOS and get consistent
# results.
platform = "linux"
# show error messages from unrelated files
follow_imports = "normal"
# suppress errors about unsatisfied imports
ignore_missing_imports = true
# be strict
check_untyped_defs = true
# disallow_any_generics = true
# disallow_incomplete_defs = true
# disallow_subclassing_any = true
# disallow_untyped_calls = true
# disallow_untyped_decorators = true
# disallow_untyped_defs = true
# no_implicit_optional = true
# strict_optional = true
# warn_incomplete_stub = true
# warn_no_return = true
# warn_redundant_casts = true
# warn_return_any = true
# warn_unused_configs = true
# warn_unused_ignores = true