Skip to content

Upgrade ruff to 0.16.5 and address new rules - #495

Open
oschwald wants to merge 4 commits into
mainfrom
greg/stf-1328-ruff-is-upgraded-in-github-python-repos
Open

Upgrade ruff to 0.16.5 and address new rules#495
oschwald wants to merge 4 commits into
mainfrom
greg/stf-1328-ruff-is-upgraded-in-github-python-repos

Conversation

@oschwald

@oschwald oschwald commented Sep 9, 2026

Copy link
Copy Markdown
Member

Dependabot's ruff 0.16 bump fails CI because 0.16 stabilized new rules and started formatting Python fences in Markdown. This PR bumps ruff and addresses the failures.

  • Bump ruff to 0.16.5 in uv.lock. The dependabot PR closes when this merges.
  • Ignore CPY001 (missing-copyright-notice). We do not want a copyright header on every file.
  • Suppress PLR0917 (too-many-positional-arguments) on the web-service client constructors and the minFraud models, where making the arguments keyword-only would break callers that pass them positionally. The existing PLR0913 suppressions do not cover the new rule.
  • Reformat the Python code blocks in Markdown. ruff 0.16 formats these by default.

Each change is its own commit.

STF-1328

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Reformatted a date-handling example for improved readability.
  • Chores

    • Updated linting configuration and annotations to align with current code-quality checks.

oschwald and others added 4 commits September 9, 2026 22:22
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ruff 0.16 stabilized this rule. We do not want a copyright header on
every source file.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ruff 0.16 stabilized too-many-positional-arguments. The existing PLR0913
suppressions do not cover it. Making these arguments keyword-only would
be a breaking change for callers that pass them positionally.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ruff 0.16 formats Python fences in Markdown files by default.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 9, 2026 22:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 66127775-c97a-48f7-ae7b-2ab2fe7bdbfe

📥 Commits

Reviewing files that changed from the base of the PR and between ce22cd8 and 54fab08.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • CLAUDE.md
  • pyproject.toml
  • src/geoip2/webservice.py

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The PR updates Ruff lint suppressions and reformats one documentation example. It does not change runtime behavior, public declarations, function signatures, or control flow.

Changes

Lint and documentation maintenance

Layer / File(s) Summary
Ruff suppression updates
pyproject.toml, src/geoip2/webservice.py
Ruff ignores CPY001. The AsyncClient and Client constructors also suppress PLR0917.
Date example formatting
CLAUDE.md
The date-parsing conditional expression is formatted on one line without changing its logic.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 54fab

This updates Ruff-related lint handling and documentation formatting without changing application behavior. No current merge-readiness risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 Ruff upgrade to version 0.16.5 and the related rule updates. It accurately summarizes the primary changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (2 skipped: 2 …
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch greg/stf-1328-ruff-is-upgraded-in-github-python-repos

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

A rabbit hops through linting light
Ruff grows quiet, rules align
One date line curls up neat
Two constructors keep their beat
No runtime paths have changed tonight

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants