mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-10 13:54:04 +02:00
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.16.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.13...v0.16.5) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 25.1.0 → 26.5.1](https://github.com/psf/black-pre-commit-mirror/compare/25.1.0...26.5.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * ci: preserve Ruff lint baseline --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bas Nijholt <bas@nijho.lt>
62 lines
2.7 KiB
TOML
62 lines
2.7 KiB
TOML
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml
|
|
|
|
target-version = "py312"
|
|
[lint]
|
|
select = ["ALL"]
|
|
|
|
# All the ones without a comment were the ones that are currently violated
|
|
# by the codebase. The plan is to fix them all (when sensible) and then enable them.
|
|
ignore = [
|
|
"ANN",
|
|
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
|
|
"CPY001", # Missing copyright notice at top of file
|
|
"D401", # First line of docstring should be in imperative mood
|
|
"E501", # line too long
|
|
"FBT001", # Boolean positional arg in function definition
|
|
"FBT002", # Boolean default value in function definition
|
|
"FIX004", # Line contains HACK, consider resolving the issue
|
|
"PERF203", # `try`-`except` within a loop incurs performance overhead
|
|
"PLC0415", # `import` should be at the top-level of a file
|
|
"PLR0913", # Too many arguments to function call (N > 5)
|
|
"PLR0917", # Too many positional arguments
|
|
"PLR2004", # Magic value used in comparison, consider replacing X with a constant variable
|
|
"RUF059", # Unpacked variable is never used
|
|
"S101", # Use of assert detected
|
|
"SLF001", # Private member accessed
|
|
"UP017", # Use datetime.UTC alias
|
|
"UP042", # Replace str, Enum inheritance with StrEnum
|
|
]
|
|
|
|
[lint.per-file-ignores]
|
|
"tests/*.py" = [
|
|
"ARG001", # Unused function argument: `call`
|
|
"D100", # Missing docstring in public module
|
|
"D103", # Missing docstring in public function
|
|
"D205", # 1 blank line required between summary line and description
|
|
"D400", # First line should end with a period
|
|
"D415", # First line should end with a period, question mark, or
|
|
"DTZ001", # The use of `datetime.datetime()` without `tzinfo`
|
|
"ERA001", # Found commented-out code
|
|
"FBT003", # Boolean positional value in function call
|
|
"FIX002", # Line contains TODO, consider resolving the issue
|
|
"G004", # Logging statement uses f-string
|
|
"PLR0915", # Too many statements (94 > 50)
|
|
"PT004", # Fixture `cleanup` does not return anything, add leading underscore
|
|
"PT007", # Wrong values type in `@pytest.mark.parametrize` expected `list` of
|
|
"S311", # Standard pseudo-random generators are not suitable for cryptographic
|
|
"TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO
|
|
"TD003", # Missing issue link on the line following this TODO
|
|
]
|
|
".github/*py" = ["INP001"]
|
|
"webapp/homeassistant_util_color.py" = ["ALL"]
|
|
"webapp/app.py" = ["INP001", "DTZ011", "A002"]
|
|
"custom_components/adaptive_lighting/homeassistant_util_color.py" = ["ALL"]
|
|
|
|
[lint.flake8-pytest-style]
|
|
fixture-parentheses = false
|
|
|
|
[lint.pyupgrade]
|
|
keep-runtime-typing = true
|
|
|
|
[lint.mccabe]
|
|
max-complexity = 25
|