Skip to content

Add type annotations and ANN lint rules#4

Merged
thetic merged 2 commits into
mainfrom
ty-up
Jan 9, 2026
Merged

Add type annotations and ANN lint rules#4
thetic merged 2 commits into
mainfrom
ty-up

Conversation

@thetic

@thetic thetic commented Jan 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Update ty from 0.0.8 to 0.0.10
  • Add flake8-annotations (ANN) rules to ruff config
  • Add type annotations to all config flow methods using TYPE_CHECKING guard for runtime efficiency

Test plan

  • uv run ruff check passes
  • uv run ty check passes
  • uv run pytest passes (27 tests)

- Update ty from 0.0.8 to 0.0.10
- Add flake8-annotations (ANN) rules to ruff config
- Ignore ANN401 (Any type) and ANN in tests
- Add type annotations to all config flow methods
- Use TYPE_CHECKING guard for type-only imports

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jan 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.68%. Comparing base (6ad07f9) to head (d7f63f5).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #4      +/-   ##
==========================================
- Coverage   98.68%   98.68%   -0.01%     
==========================================
  Files           6        6              
  Lines         305      304       -1     
==========================================
- Hits          301      300       -1     
  Misses          4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Move imports only used for type hints behind TYPE_CHECKING to avoid
importing them at runtime:
- sensor.py: Event, HomeAssistant, AddEntitiesCallback, EventStateChangedData
- button.py: HomeAssistant, AddEntitiesCallback
- date.py: HomeAssistant, AddEntitiesCallback
@thetic
thetic merged commit 002dddb into main Jan 9, 2026
8 checks passed
@thetic
thetic deleted the ty-up branch January 11, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants