Skip to content

Conversation

@cgoldberg
Copy link
Member

@cgoldberg cgoldberg commented May 30, 2025

User description

💥 What does this PR do?

This PR adjusts the linting/formatting (ruff) settings in ./py/tox.ini so it scans the entire ./py directory tree, not just specific directories. Previously, it was skipping files in the directory root. This brings tox in line with how we do linting in CI via bazel.

🔄 Types of changes

  • internal/build infrastructure

PR Type

Enhancement


Description

  • Update ruff linting to cover all Python files

  • Change ruff commands to scan entire ./py directory

  • Align tox linting with CI (bazel) behavior


Changes walkthrough 📝

Relevant files
Configuration changes
tox.ini
Update tox ruff commands to lint all Python files               

py/tox.ini

  • Modified ruff lint and format commands to target all files in the
    directory
  • Replaced specific file/directory targets with a dot (.)
  • Ensures no Python files are skipped during linting/formatting
  • +2/-2     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @selenium-ci selenium-ci added the C-py Python Bindings label May 30, 2025
    @qodo-merge-pro
    Copy link
    Contributor

    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
    ⚡ No major issues detected

    @qodo-merge-pro
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Add exclusions to linting

    Using . without exclusions will lint and format all Python files in the
    directory, including potentially unwanted files like virtual environments, build
    artifacts, or third-party code. Consider adding exclusions or specifying target
    directories.

    py/tox.ini [40-41]

    -ruff check --fix --show-fixes --exit-non-zero-on-fix .
    -ruff format --exit-non-zero-on-format .
    +ruff check --fix --show-fixes --exit-non-zero-on-fix . --exclude .venv/,build/,dist/
    +ruff format --exit-non-zero-on-format . --exclude .venv/,build/,dist/
    • Apply / Chat
    Suggestion importance[1-10]: 6

    __

    Why: Valid concern about using . without exclusions potentially linting unwanted directories like virtual environments or build artifacts. This is a reasonable best practice improvement for performance and cleanliness.

    Low
    • More

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

    Labels

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants