Skip to content

Conversation

@aseembits93
Copy link
Contributor

@aseembits93 aseembits93 commented May 27, 2025

User description

This will ensure we do not accidentally reformat Union to |


PR Type

Enhancement


Description

  • Add target-version = "py39"

  • Prevent Union-to-| reformatting

  • Target Python 3.9+ by Ruff


Changes walkthrough 📝

Relevant files
Configuration changes
pyproject.toml
Add Ruff target-version configuration                                       

pyproject.toml

  • Added target-version = "py39" setting
  • Ensures Ruff targets Python 3.9+
  • +1/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Config Compatibility

    Verify that the CI and local environments use a Ruff version that supports target-version = "py39", otherwise the new setting may be ignored or cause errors.

    target-version = "py39"

    @github-actions
    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Use array for target-version

    Ruff expects target-version to be a TOML array of strings rather than a single
    string. Converting to an array ensures future support for multiple versions and
    correct parsing.

    pyproject.toml [154]

    -target-version = "py39"
    +target-version = ["py39"]
    Suggestion importance[1-10]: 8

    __

    Why: The target-version setting in Ruff expects a TOML array of strings, so using ["py39"] ensures correct parsing and allows future multiple versions.

    Medium

    @aseembits93 aseembits93 requested a review from KRRT7 May 27, 2025 17:45
    @aseembits93 aseembits93 merged commit eae1592 into main May 27, 2025
    17 checks passed
    @aseembits93 aseembits93 deleted the ruff-target-python39 branch May 27, 2025 18:01
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    4 participants