Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ 🛠️(deps): update dependency ruff to ^0.9.0 #2044

Merged
merged 2 commits into from
Jan 11, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 9, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
ruff (source, changelog) ^0.8.0 -> ^0.9.0 age adoption passing confidence

Release Notes

astral-sh/ruff (ruff)

v0.9.0

Compare Source

Check out the blog post for a migration guide and overview of the changes!

Breaking changes

Ruff now formats your code according to the 2025 style guide. As a result, your code might now get formatted differently. See the formatter section for a detailed list of changes.

This release doesn’t remove or remap any existing stable rules.

Stabilization

The following rules have been stabilized and are no longer in preview:

The following behaviors have been stabilized:

The following fixes or improvements to fixes have been stabilized:

Formatter

This release introduces the new 2025 stable style (#​13371), stabilizing the following changes:

  • Format expressions in f-string elements (#​7594)
  • Alternate quotes for strings inside f-strings (#​13860)
  • Preserve the casing of hex codes in f-string debug expressions (#​14766)
  • Choose the quote style for each string literal in an implicitly concatenated f-string rather than for the entire string (#​13539)
  • Automatically join an implicitly concatenated string into a single string literal if it fits on a single line (#​9457)
  • Remove the ISC001 incompatibility warning (#​15123)
  • Prefer parenthesizing the assert message over breaking the assertion expression (#​9457)
  • Automatically parenthesize over-long if guards in match case clauses (#​13513)
  • More consistent formatting for match case patterns (#​6933)
  • Avoid unnecessary parentheses around return type annotations (#​13381)
  • Keep the opening parentheses on the same line as the if keyword for comprehensions where the condition has a leading comment (#​12282)
  • More consistent formatting for with statements with a single context manager for Python 3.8 or older (#​10276)
  • Correctly calculate the line-width for code blocks in docstrings when using max-doc-code-line-length = "dynamic" (#​13523)
Preview features
  • [flake8-bugbear] Implement class-as-data-structure (B903) (#​9601)
  • [flake8-type-checking] Apply quoted-type-alias more eagerly in TYPE_CHECKING blocks and ignore it in stubs (TC008) (#​15180)
  • [pylint] Ignore eq-without-hash in stub files (PLW1641) (#​15310)
  • [pyupgrade] Split UP007 into two individual rules: UP007 for Union and UP045 for Optional (UP007, UP045) (#​15313)
  • [ruff] New rule that detects classes that are both an enum and a dataclass (RUF049) (#​15299)
  • [ruff] Recode RUF025 to RUF037 (RUF037) (#​15258)
Rule changes
Server
  • Improve the observability by removing the need for the "trace" value to turn on or off logging. The server logging is solely controlled using the logLevel server setting
    which defaults to info. This addresses the issue where users were notified about an error and told to consult the log, but it didn’t contain any messages. (#​15232)
  • Ignore diagnostics from other sources for code action requests (#​15373)
CLI
  • Improve the error message for --config key=value when the key is for a table and it’s a simple value
Bug fixes
  • [eradicate] Ignore metadata blocks directly followed by normal blocks (ERA001) (#​15330)
  • [flake8-django] Recognize other magic methods (DJ012) (#​15365)
  • [pycodestyle] Avoid false positives related to type aliases (E252) (#​15356)
  • [pydocstyle] Avoid treating newline-separated sections as sub-sections (D405) (#​15311)
  • [pyflakes] Remove call when removing final argument from format (F523) (#​15309)
  • [refurb] Mark fix as unsafe when the right-hand side is a string (FURB171) (#​15273)
  • [ruff] Treat ) as a regex metacharacter (RUF043, RUF055) (#​15318)
  • [ruff] Parenthesize the int-call argument when removing the int call would change semantics (RUF046) (#​15277)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Jan 9, 2025
Copy link

sourcery-ai bot commented Jan 9, 2025

Reviewer's Guide by Sourcery

This PR updates the ruff dependency from ^0.8.0 to ^0.9.0. This update introduces the 2025 style guide for formatting, stabilizes several rules and behaviors, adds preview features, changes some rules, improves the server and CLI, and fixes various bugs.

State diagram for Ruff version transition

stateDiagram-v2
    [*] --> Ruff_0.8.0
    Ruff_0.8.0 --> Ruff_0.9.0: Update

    state Ruff_0.8.0 {
        [*] --> Old_Style
        Old_Style --> [*]
    }

    state Ruff_0.9.0 {
        [*] --> Style_2025
        Style_2025: 2025 Style Guide
        Style_2025: Stabilized Rules
        Style_2025: New Preview Features
        Style_2025 --> [*]
    }
Loading

File-Level Changes

Change Details Files
Updated the ruff dependency
  • Changed the ruff version from "^0.8.0" to "^0.9.0" in the pyproject.toml file
pyproject.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. Here's why:

  • It seems to have been created by a bot (hey, renovate[bot]!). We assume it knows what it's doing!
  • We don't review packaging changes - Let us know if you'd like us to change this.

Copy link

@llamapreview llamapreview bot left a comment

Choose a reason for hiding this comment

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

Auto Pull Request Review from LlamaPReview

1. Overview

1.1 Core Changes

  • Primary purpose and scope: Update the ruff dependency to version ^0.9.0.
  • Key components modified: pyproject.toml
  • Cross-component impacts: None
  • Business value alignment: Ensures the codebase is up-to-date with the latest linting and formatting rules, which can improve code quality and maintainability.

1.2 Technical Architecture

  • System design modifications: None
  • Component interaction changes: None
  • Integration points impact: None
  • Dependency changes and implications: Updating ruff to ^0.9.0 introduces new formatting rules and stabilizes several existing rules, which may affect the code formatting and linting results.

2. Deep Technical Analysis

2.1 Code Logic Analysis

pyproject.toml - [tool.poetry.group.dev.dependencies]

  • Submitted PR Code:
  [tool.poetry.group.dev.dependencies]
  python-semantic-release = ">=8.0.8"
  -ruff = "^0.8.0"
  +ruff = "^0.9.0"
  pre-commit = "^4.0.0"
  • Analysis:

    • Current logic and potential issues: The update to ruff version ^0.9.0 introduces new formatting rules and stabilizes several existing rules. This may result in different formatting and linting outputs, which could affect the codebase.
    • Edge cases and error handling: The new formatting rules might introduce edge cases where the code is formatted differently than expected. This could lead to inconsistencies in the codebase.
    • Cross-component impact: None
    • Business logic considerations: None
  • LlamaPReview Suggested Improvements: None

  • Improvement rationale: None

2.2 Implementation Quality

  • Code Structure:

    • Organization and modularity: The change is isolated to the pyproject.toml file, which is appropriate for a dependency update.
    • Design pattern adherence: N/A
    • Reusability aspects: N/A
    • Maintainability factors: Updating dependencies regularly helps maintain the codebase and ensures compatibility with the latest tools and libraries.
  • Error Handling:

    • Exception scenarios coverage: N/A
    • Recovery mechanisms: N/A
    • Logging and monitoring: N/A
    • User experience impact: Developers may need to adapt to the new formatting rules introduced by ruff version ^0.9.0.
  • Performance Considerations:

    • Resource utilization: N/A
    • Scalability aspects: N/A
    • Bottleneck analysis: N/A
    • Optimization opportunities: N/A

3. Risk Assessment

3.1 Critical Issues

🔴 P0 (Must Fix):

  • Issue: Potential formatting inconsistencies due to new rules in ruff version ^0.9.0.
  • Impact:
    • Technical implications: The codebase may be reformatted in a way that differs from the current style, leading to inconsistencies.
    • Business consequences: Developers may need to spend time adjusting to the new formatting rules.
    • User experience effects: None
  • Resolution:
    • Specific code changes: None
    • Configuration updates: Review the formatting changes introduced in ruff version ^0.9.0 and update the codebase accordingly.
    • Testing requirements: Run linting and formatting checks to ensure the codebase adheres to the new rules.

3.2 Important Improvements

🟡 P1 (Should Fix):

  • Issue: Ensure compatibility with other dependencies.
  • Current Impact:
    • Performance implications: None
    • Maintenance overhead: None
    • Future scalability: None
  • Suggested Solution:
    • Implementation approach: Verify that the updated ruff version is compatible with other dependencies in the project.
    • Migration strategy: Update the ruff version and run compatibility tests.
    • Testing considerations: Ensure that all linting and formatting checks pass without issues.

3.3 Minor Suggestions

🟢 P2 (Consider):

  • Area: Documentation updates.
  • Improvement Opportunity:
    • Code quality enhancement: Update the project documentation to reflect the changes in linting and formatting rules introduced by ruff version ^0.9.0.
    • Best practice alignment: Ensure that the documentation provides clear guidelines on the new formatting rules.
    • Documentation updates: Update the documentation to include information on the new formatting rules and any changes in linting behavior.

4. Requirements Analysis

4.1 Functional Coverage

  • Requirements mapping:
    • Implemented features: Update ruff dependency to version ^0.9.0.
    • Missing elements: None
    • Edge cases handling: Ensure that the new formatting rules do not introduce inconsistencies in the codebase.
  • Business Logic:
    • Use case coverage: The update ensures that the codebase adheres to the latest linting and formatting standards.
    • Business rule implementation: None
    • Data flow correctness: None

4.2 Non-functional Aspects

  • Performance metrics: N/A
  • Security considerations: N/A
  • Scalability factors: N/A
  • Maintainability aspects: Regularly updating dependencies helps maintain the codebase and ensures compatibility with the latest tools and libraries.

5. Testing Strategy

  • Test Coverage:
    • Unit test requirements: Ensure that all linting and formatting checks pass without issues.
    • Integration test scenarios: Verify that the updated ruff version is compatible with other dependencies in the project.
    • Edge case validation: Test the codebase against the new formatting rules to ensure consistency.
  • Quality Metrics:
    • Current coverage: N/A
    • Critical paths: N/A
    • Performance benchmarks: N/A

6. Final Assessment

6.1 Key Action Items

  1. Critical Changes (P0):

    • Review the formatting changes introduced in ruff version ^0.9.0 and update the codebase accordingly.
  2. Important Improvements (P1):

    • Verify that the updated ruff version is compatible with other dependencies in the project.
  3. Suggested Enhancements (P2):

    • Update the project documentation to reflect the changes in linting and formatting rules introduced by ruff version ^0.9.0.

6.2 Overall Evaluation

  • Technical assessment: The update to ruff version ^0.9.0 introduces new formatting rules and stabilizes several existing rules, which may affect the codebase. Regularly updating dependencies helps maintain the codebase and ensures compatibility with the latest tools and libraries.
  • Business impact: Ensures the codebase is up-to-date with the latest linting and formatting rules, which can improve code quality and maintainability.
  • Risk evaluation: There is a risk of formatting inconsistencies due to the new rules introduced in ruff version ^0.9.0.
  • Implementation quality: The change is isolated to the pyproject.toml file, which is appropriate for a dependency update. Updating dependencies regularly helps maintain the codebase and ensures compatibility with the latest tools and libraries.

💡 LlamaPReview Community
Have feedback on this AI Code review tool? Join our GitHub Discussions to share your thoughts and help shape the future of LlamaPReview.

@github-actions github-actions bot enabled auto-merge January 9, 2025 14:42
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.19%. Comparing base (c407e04) to head (c78fa25).
Report is 3 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2044   +/-   ##
=======================================
  Coverage   83.19%   83.19%           
=======================================
  Files          12       12           
  Lines         488      488           
=======================================
  Hits          406      406           
  Misses         82       82           

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

@github-actions github-actions bot merged commit 1d48bee into dev Jan 11, 2025
9 checks passed
@github-actions github-actions bot deleted the renovate/ruff-0.x branch January 11, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant