fix: resolve ruff stable lint errors blocking the renovate pipeline - #136
Conversation
|
Warning Review limit reached
Next review available in: 54 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThe change updates service-status APIs to accept complete message objects, makes service construction arguments keyword-only, updates affected call sites and tests, and applies Ruff-aligned formatting and lint changes. ChangesService API modernization
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #136 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 139 139
Lines 13509 13510 +1
Branches 785 785
=========================================
+ Hits 13509 13510 +1 ☔ View full report in Codecov by Harness. |
Align the prek ruff pin with the uv lockfile (ruff 0.16.0) so local hooks and CI agree. ruff 0.16 no longer raises BLE001 where the rendered -text diagnostic guard logs and swallows, which lets the unused noqa directives be removed in the follow-up commit.
PR #134 enabled all stable ruff rules. Resolve the resulting findings by fixing the underlying structure rather than suppressing, except where a real fix is disproportional. PLR0917 (too many positional arguments): - service-status state store + protocol now take the ServiceStatusMessage object instead of unpacking five message fields; the monitor stops hand-unpacking messages at every call site. - BriefingService.__init__ is keyword-only (single production call site). - ServiceStatusMonitor moves the optional language flag to keyword-only. - The parametrized any-llm factory test uses keyword-only parameters. - _briefing_service keeps positional form (37 call sites) and is the only justified PLR0917 suppression. ISC004: wrap implicitly concatenated strings in collections with parens. RUF100: drop the two BLE001 noqas that ruff 0.16 no longer needs.
1f43e6c to
e5f4e7d
Compare
PR #134 enabled all stable ruff rules, which left 13 lint errors on
masterand blocked renovate PR #131 (and every other PR). This fixes them on a fresh branch offmaster.Findings
PLR0917too many positional argsISC004unparenthesized string concat in collectionRUF100unusedBLE001noqaPLR0917 — fixed by structure, not suppression
The feedback on an earlier attempt was to avoid extending
noqawhitelists where a real fix exists. Each site was evaluated individually:observe_service_status_message/mark_service_status_message_handled): the monitor was hand-unpacking fivemessagefields into every call. The store now takes theServiceStatusMessageobject directly. This removes the unpacking smell, not just the lint. Removes# noqa: PLR0913entirely.BriefingService.__init__: made keyword-only — the only production call site (cli.py) now wires collaborators by name.ServiceStatusMonitor.__init__: the optionallanguageflag moves to keyword-only (idiomatic for defaulted params); 3 call sites updated.test_factory_normalizes_provider_native_request_errors: parametrize dimensions moved to keyword-only (pytest 9 supports this)._briefing_servicetest factory: the onlyPLR0917suppression kept, with an inline justification. It mirrorsBriefingServicebut has 37 positional call sites acrosstest_service.py; forcing keyword-only there would be disproportional churn with no structural benefit.Infra
Also bumps the prek ruff hook to v0.16.0 to match the uv lockfile, so local hooks and CI agree on whether
BLE001fires (the root cause of theRUF100findings).Verification
uv run ruff check .— cleanprek run --all-files— cleanuv run pytest --cov --cov-branch— 1338 passed; coverage unaffected (pure refactor, no tests removed)Summary by CodeRabbit
Refactor
Chores
Tests