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

[py] Ignore devtools during linting #15410

Merged
merged 2 commits into from
Mar 13, 2025

Conversation

cgoldberg
Copy link
Contributor

@cgoldberg cgoldberg commented Mar 13, 2025

User description

Motivation and Context

This PR updates the linting configuration for Python.

After you run build target //py:local_dev, generated Python source files are copied to selenium/webdriver/common/devtools. When you try to run linting after that (by building //py:lint or running tox -e linting), it fails with all sorts of linting violations in the devtools files.

I don't think we care or want to fix violations in these files, so this change just ignores them.

Changes made:

  • Exclude the selenium/webdriver/common/devtools directory in linting tool configurations (black, flake8, docformatter).

  • Updates Python version to 3.9 in linting tool section of pyproject.toml for isort and black. This was previously set to Python 3.8, but the minimum supported version is Python 3.9 (I'm not sure this change actually affects anything)

I tested locally by running go py:local_dev then ./go py:lint and tox -c py/tox.ini -e linting.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Bug fix, Enhancement


Description

  • Excluded selenium/webdriver/common/devtools directory from linting tools.

  • Updated Python version to 3.9 in linting configurations.

  • Adjusted tox.ini to align with updated linting exclusions.


Changes walkthrough 📝

Relevant files
Configuration changes
pyproject.toml
Adjust linting configurations and Python version in pyproject.toml

py/pyproject.toml

  • Added selenium/webdriver/common/devtools to extend-exclude for black.
  • Updated Python version from 3.8 to 3.9 for isort and black.
  • Added selenium/webdriver/common/devtools to exclude for docformatter.
  • +4/-2     
    tox.ini
    Update tox.ini to exclude devtools from linting                   

    py/tox.ini

  • Excluded selenium/webdriver/common/devtools directory in flake8.
  • Updated linting commands to align with exclusions.
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Sorry, something went wrong.

    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

    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Copy link
    Member

    @titusfortner titusfortner left a comment

    Choose a reason for hiding this comment

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

    yeah, it's in .gitignore too:

    py/selenium/webdriver/common/devtools/**/*
    

    @cgoldberg cgoldberg merged commit 3cb7784 into SeleniumHQ:trunk Mar 13, 2025
    12 of 17 checks passed
    @cgoldberg cgoldberg deleted the linting-ignore branch March 13, 2025 14:55
    sandeepsuryaprasad pushed a commit to sandeepsuryaprasad/selenium that referenced this pull request Mar 23, 2025
    This excludes code in the `selenium/webdriver/common/devtools` directory from Python linting tool configurations (black, flake8, docformatter), so linting can run without complaining about devtools violations.
    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.

    None yet

    2 participants