Use specific rule code on test_log_reader type-ignore#1688
Conversation
PGH003 (enabled in #1684) flags bare `# type: ignore` comments and the existing one on the protobuf import in `tests/test_log_reader.py` was missed in the rollout, so `ruff check` fails on main. Switching to `# type: ignore[attr-defined]` matches the dynamic-attribute nature of `api_pb2.SubscribeLogsResponse` and gets CI green again.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1688 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 25 25
Lines 4159 4159
=========================================
Hits 4159 4159 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA single import line in the test log reader updates its type checker suppression comment to narrow the scope from a generic ChangesType Checker Suppression Refinement
🎯 1 (Trivial) | ⏱️ ~2 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the tests/test_log_reader.py protobuf import to use a specific # type: ignore[...] code so ruff’s PGH003 rule no longer flags it, restoring CI on main and open PRs.
Changes:
- Replace a bare
# type: ignorewith# type: ignore[attr-defined]on theSubscribeLogsResponseimport in the log reader test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What does this implement/fix?
PGH003 (enabled in #1684) flags bare
# type: ignorecomments, but the existing one on the protobuf import intests/test_log_reader.pywas missed in the rollout;ruff checknow fails on main and on every open PR. Switching the comment to# type: ignore[attr-defined]matches the dynamic-attribute shape ofapi_pb2.SubscribeLogsResponseand unblocks CI.One-line change, lint-only.
Types of changes
Related issue or feature (if applicable):
Pull request in esphome (if applicable):
Checklist:
tests/folder).