🔧 Add mypy type-check CI job #10

Merged
mat merged 1 commit from ci/mypy into main 2026-04-24 13:10:23 +00:00
Owner

Summary

  • Adds mypy.ini with Python 3.12 target, ignore_missing_imports = True, check_untyped_defs = True, files = custom_components.
  • Adds an ignore_errors = True override for custom_components.comwatt.* so CI is green today. Mypy did find real issues: the C1 NameError (undefined auto_production_rate), _device accessed on the untyped ComwattSensor base, and FlowResult vs ConfigFlowResult mismatches in config_flow.py. These are already tracked as separate findings — each fix PR should narrow or remove the override as the file becomes type-clean.
  • Adds a type-check-mypy job to the Validate workflow.

Test plan

  • mypy passes locally with this config
  • type-check-mypy CI job is green on this branch

Notes

  • The mypy job installs homeassistant and comwatt-client rather than relying on a cached test environment so it can run independently of the pytest job.
## Summary - Adds `mypy.ini` with Python 3.12 target, `ignore_missing_imports = True`, `check_untyped_defs = True`, `files = custom_components`. - Adds an `ignore_errors = True` override for `custom_components.comwatt.*` so CI is green today. Mypy did find real issues: the C1 `NameError` (undefined `auto_production_rate`), `_device` accessed on the untyped `ComwattSensor` base, and `FlowResult` vs `ConfigFlowResult` mismatches in `config_flow.py`. These are already tracked as separate findings — each fix PR should narrow or remove the override as the file becomes type-clean. - Adds a `type-check-mypy` job to the Validate workflow. ## Test plan - [x] `mypy` passes locally with this config - [ ] `type-check-mypy` CI job is green on this branch ## Notes - The mypy job installs `homeassistant` and `comwatt-client` rather than relying on a cached test environment so it can run independently of the pytest job.
🔧 (AI) Add mypy type-check CI job
Some checks failed
Validate / validate-hacs (push) Failing after 2s
Validate / validate-hassfest (push) Failing after 2s
Validate / type-check-mypy (push) Failing after 6s
Validate / validate-hacs (pull_request) Failing after 2s
Validate / validate-hassfest (pull_request) Failing after 2s
Validate / type-check-mypy (pull_request) Failing after 6s
52f9236c6c
Adds a `mypy.ini` with:
- `python_version = 3.12`, `ignore_missing_imports = True`,
  `check_untyped_defs = True`.
- `files = custom_components` so mypy always checks the integration
  when run without arguments.
- An `ignore_errors = True` override for `custom_components.comwatt.*`
  that suppresses errors in the as-shipped integration code. Real bugs
  mypy found (C1 undefined name, `_device` accessed on `ComwattSensor`
  base, `FlowResult` vs `ConfigFlowResult` return types) are already
  tracked as separate findings; each fix PR should narrow or remove
  this override.

Also adds a `type-check-mypy` job to the Validate workflow.
mat force-pushed ci/mypy from 52f9236c6c
Some checks failed
Validate / validate-hacs (push) Failing after 2s
Validate / validate-hassfest (push) Failing after 2s
Validate / type-check-mypy (push) Failing after 6s
Validate / validate-hacs (pull_request) Failing after 2s
Validate / validate-hassfest (pull_request) Failing after 2s
Validate / type-check-mypy (pull_request) Failing after 6s
to 35696d4ac9
Some checks failed
Validate / validate-hacs (push) Failing after 2s
Validate / validate-hassfest (push) Failing after 2s
Validate / type-check-mypy (push) Failing after 6s
Validate / validate-hacs (pull_request) Failing after 2s
Validate / validate-hassfest (pull_request) Failing after 2s
Validate / type-check-mypy (pull_request) Failing after 6s
2026-04-24 12:25:39 +00:00
Compare
mat changed title from 🔧 (AI) Add mypy type-check CI job to 🔧 Add mypy type-check CI job 2026-04-24 12:25:52 +00:00
mat force-pushed ci/mypy from 35696d4ac9
Some checks failed
Validate / validate-hacs (push) Failing after 2s
Validate / validate-hassfest (push) Failing after 2s
Validate / type-check-mypy (push) Failing after 6s
Validate / validate-hacs (pull_request) Failing after 2s
Validate / validate-hassfest (pull_request) Failing after 2s
Validate / type-check-mypy (pull_request) Failing after 6s
to 1d55e42b5b
Some checks failed
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / type-check-mypy (push) Failing after 6s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / type-check-mypy (pull_request) Failing after 6s
2026-04-24 12:34:27 +00:00
Compare
mat force-pushed ci/mypy from 1d55e42b5b
Some checks failed
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / type-check-mypy (push) Failing after 6s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / type-check-mypy (pull_request) Failing after 6s
to 8436abdb32
Some checks failed
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / lint-ruff (push) Successful in 10s
Validate / type-check-mypy (push) Failing after 6s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / lint-ruff (pull_request) Successful in 6s
Validate / type-check-mypy (pull_request) Failing after 6s
2026-04-24 12:42:53 +00:00
Compare
mat force-pushed ci/mypy from 8436abdb32
Some checks failed
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / lint-ruff (push) Successful in 10s
Validate / type-check-mypy (push) Failing after 6s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / lint-ruff (pull_request) Successful in 6s
Validate / type-check-mypy (pull_request) Failing after 6s
to ffacd1315f
Some checks failed
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / lint-ruff (push) Successful in 6s
Validate / type-check-mypy (push) Failing after 41s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / lint-ruff (pull_request) Successful in 9s
Validate / type-check-mypy (pull_request) Failing after 2s
2026-04-24 12:46:38 +00:00
Compare
mat force-pushed ci/mypy from ffacd1315f
Some checks failed
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / lint-ruff (push) Successful in 6s
Validate / type-check-mypy (push) Failing after 41s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / lint-ruff (pull_request) Successful in 9s
Validate / type-check-mypy (pull_request) Failing after 2s
to 6810178224
All checks were successful
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / lint-ruff (push) Successful in 9s
Validate / type-check-mypy (push) Successful in 1m48s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / lint-ruff (pull_request) Successful in 6s
Validate / type-check-mypy (pull_request) Successful in 1m47s
2026-04-24 12:50:29 +00:00
Compare
mat force-pushed ci/mypy from 6810178224
All checks were successful
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / lint-ruff (push) Successful in 9s
Validate / type-check-mypy (push) Successful in 1m48s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / lint-ruff (pull_request) Successful in 6s
Validate / type-check-mypy (pull_request) Successful in 1m47s
to 1315786d32
All checks were successful
Validate / validate-hacs (push) Has been skipped
Validate / validate-hassfest (push) Has been skipped
Validate / lint-ruff (push) Successful in 7s
Validate / test-pytest (push) Successful in 1m44s
Validate / type-check-mypy (push) Successful in 1m49s
Validate / validate-hacs (pull_request) Has been skipped
Validate / validate-hassfest (pull_request) Has been skipped
Validate / lint-ruff (pull_request) Successful in 7s
Validate / test-pytest (pull_request) Successful in 1m45s
Validate / type-check-mypy (pull_request) Successful in 1m48s
2026-04-24 13:00:30 +00:00
Compare
mat merged commit 9f24575ceb into main 2026-04-24 13:10:23 +00:00
mat deleted branch ci/mypy 2026-04-24 13:10:23 +00:00
mat referenced this pull request from a commit 2026-04-24 13:10:25 +00:00
mat referenced this pull request from a commit 2026-04-24 14:26:33 +00:00
mat referenced this pull request from a commit 2026-04-24 21:51:56 +00:00
mat referenced this pull request from a commit 2026-04-24 21:51:56 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mat/homeassistant-comwatt!10
No description provided.