Skip to content

fix: resolve ruff stable lint errors blocking the renovate pipeline - #136

Merged
IceCodeNew merged 2 commits into
masterfrom
fix/ruff-stable-lint-errors
Aug 4, 2026
Merged

fix: resolve ruff stable lint errors blocking the renovate pipeline#136
IceCodeNew merged 2 commits into
masterfrom
fix/ruff-stable-lint-errors

Conversation

@IceCodeNew

@IceCodeNew IceCodeNew commented Aug 4, 2026

Copy link
Copy Markdown
Owner

PR #134 enabled all stable ruff rules, which left 13 lint errors on master and blocked renovate PR #131 (and every other PR). This fixes them on a fresh branch off master.

Findings

Rule Count Resolution
PLR0917 too many positional args 8 structural fixes (see below)
ISC004 unparenthesized string concat in collection 3 wrapped in parens
RUF100 unused BLE001 noqa 2 removed (ruff 0.16 no longer flags those sites)

PLR0917 — fixed by structure, not suppression

The feedback on an earlier attempt was to avoid extending noqa whitelists where a real fix exists. Each site was evaluated individually:

  • service-status state store + protocol (observe_service_status_message / mark_service_status_message_handled): the monitor was hand-unpacking five message fields into every call. The store now takes the ServiceStatusMessage object directly. This removes the unpacking smell, not just the lint. Removes # noqa: PLR0913 entirely.
  • BriefingService.__init__: made keyword-only — the only production call site (cli.py) now wires collaborators by name.
  • ServiceStatusMonitor.__init__: the optional language flag 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_service test factory: the only PLR0917 suppression kept, with an inline justification. It mirrors BriefingService but has 37 positional call sites across test_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 BLE001 fires (the root cause of the RUF100 findings).

Verification

  • uv run ruff check . — clean
  • prek run --all-files — clean
  • uv run pytest --cov --cov-branch — 1338 passed; coverage unaffected (pure refactor, no tests removed)

Summary by CodeRabbit

  • Refactor

    • Improved service-status message handling for more consistent validation and persistence.
    • Standardized service configuration and language settings to reduce setup ambiguity.
    • Preserved existing briefing, notification, geocoding, and service-status behavior.
  • Chores

    • Updated development linting tools and streamlined code quality checks.
  • Tests

    • Refined automated coverage to reflect the updated service and message-handling interfaces.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@IceCodeNew, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 86c43b9d-5e22-4308-b28d-3a33486ff654

📥 Commits

Reviewing files that changed from the base of the PR and between 1f43e6c and e5f4e7d.

📒 Files selected for processing (12)
  • prek.toml
  • tests/test_any_llm_provider.py
  • tests/test_geocoding.py
  • tests/test_service.py
  • tests/test_service_status.py
  • weather_briefing/cli.py
  • weather_briefing/delivery/base.py
  • weather_briefing/delivery/telegram_renderer.py
  • weather_briefing/llm/any_llm.py
  • weather_briefing/persistence/service_status.py
  • weather_briefing/service.py
  • weather_briefing/service_status/monitor.py
📝 Walkthrough

Walkthrough

The 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.

Changes

Service API modernization

Layer / File(s) Summary
Service-status message flow
weather_briefing/service_status/..., weather_briefing/persistence/service_status.py, tests/test_service_status.py
Service-status observation and handling now use ServiceStatusMessage objects. Persistence derives stored fields from the message.
Keyword-only service construction
weather_briefing/service.py, weather_briefing/cli.py, tests/test_service.py, tests/test_service_status.py
BriefingService dependencies and ServiceStatusMonitor.language use keyword-only arguments. Production and test call sites now use named arguments.
Lint-aligned syntax and formatting
prek.toml, tests/test_any_llm_provider.py, tests/test_geocoding.py, weather_briefing/delivery/*, weather_briefing/llm/any_llm.py
The Ruff revision is updated. Tests and source use adjusted formatting and remove two BLE001 suppressions without changing runtime behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.47% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: resolving Ruff stable lint errors that blocked the Renovate pipeline.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ruff-stable-lint-errors

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1e4b86f) to head (e5f4e7d).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

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.
@IceCodeNew
IceCodeNew force-pushed the fix/ruff-stable-lint-errors branch from 1f43e6c to e5f4e7d Compare August 4, 2026 03:00
@IceCodeNew
IceCodeNew merged commit b5af062 into master Aug 4, 2026
15 checks passed
@IceCodeNew
IceCodeNew deleted the fix/ruff-stable-lint-errors branch August 4, 2026 03:00
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.

1 participant