[py] Ignore devtools during linting #15410
Merged
+5
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toselenium/webdriver/common/devtools
. When you try to run linting after that (by building//py:lint
or runningtox -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
andtox -c py/tox.ini -e linting
.Types of changes
Checklist
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 📝
pyproject.toml
Adjust linting configurations and Python version in pyproject.toml
py/pyproject.toml
selenium/webdriver/common/devtools
toextend-exclude
for black.selenium/webdriver/common/devtools
toexclude
for docformatter.tox.ini
Update tox.ini to exclude devtools from linting
py/tox.ini
selenium/webdriver/common/devtools
directory in flake8.