Skip to content

v1.6.0 - Ruff, mypy strict, pre-commit

Choose a tag to compare

@EnO33 EnO33 released this 25 Apr 10:07

Code quality tooling

Three new quality gates run on every push and pull request:

  • Ruff (linter + formatter) configured with the same rule set Home Assistant core enforces internally. Catches unused imports, async pitfalls, security smells, naming, pyupgrade opportunities. Auto-formats the whole codebase.
  • Mypy strict passes on every module of the integration. The HA / aiohttp boundary remains permissive (those packages don't ship full stubs) but our own code is fully typed.
  • Pre-commit hooks mirror the CI checks so issues are caught locally before pushing.

Code changes triggered by the linters

  • Renamed EauxDeMarseilleeSensor to EauxDeMarseilleSensor (typo with double 'e').
  • Replaced asyncio.TimeoutError with the built-in TimeoutError (Python 3.11+).
  • Replaced datetime.timezone.utc with the datetime.UTC alias.
  • Use logging.exception instead of logging.error in except blocks where the exception object would otherwise be lost.
  • Replace assert self._reauth_entry is not None with an explicit RuntimeError; asserts get stripped under python -O.
  • Add explicit return-type annotations for values mypy could only infer as Any.

CI matrix

  • Lint (ruff) — checks linting and formatting
  • Typecheck (mypy strict) — full type analysis
  • Pytest (Python 3.12 + 3.13) — 42 tests, 98% coverage, 95% threshold
  • Hassfest — HA manifest and structure validation
  • HACS — repository compliance

No user-facing change. Update via HACS as usual.