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] moved flake8 settings to tox.ini from setup.cfg #14749

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

sandeepsuryaprasad
Copy link
Contributor

@sandeepsuryaprasad sandeepsuryaprasad commented Nov 12, 2024

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Moved flake8 settings from setup.cfg to tox.ini thus eliminating setup.cfg completely.

Motivation and Context

  • This eliminates the need to have setup.cfg file.
  • since flake8 settings can be maintained in tox.ini, there is no need to maintain a separate config file which is setup.cfg just to maintain flake8 settings.
  • We can accommodate flake8 settings in tox.ini and can completely get rid of setup.cfg file

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

enhancement, configuration changes


Description

  • Moved flake8 settings from setup.cfg to tox.ini, consolidating configuration files.
  • Removed setup.cfg from the Bazel build data, as it is no longer needed.
  • This change simplifies the configuration by maintaining flake8 settings in tox.ini.

Changes walkthrough 📝

Relevant files
Configuration changes
BUILD.bazel
Remove `setup.cfg` from Bazel build data                                 

py/BUILD.bazel

  • Removed setup.cfg from the data section.
+0/-1     
setup.cfg
Remove `flake8` settings from `setup.cfg`                               

py/setup.cfg

  • Deleted the flake8 configuration section.
+0/-6     
tox.ini
Add `flake8` settings to `tox.ini`                                             

py/tox.ini

  • Added flake8 configuration section.
+7/-0     

💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

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
⚡ Recommended focus areas for review

Code Smell
The comment states that E501 (line length) rule is ignored until black is applied, but black is already being used in the same file. Consider removing the ignore rule if black is handling line length.

Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Score
Maintainability
Add explanatory comments for flake8 error code suppressions to improve configuration maintainability

Consider adding a comment explaining why E203 is ignored, as it's not immediately
clear why this error code needs to be disabled.

py/tox.ini [65]

+# E501: Line too long (handled by black)
+# E203: Whitespace before ':' (conflicts with black)
 extend-ignore = E501, E203
  • Apply this suggestion
Suggestion importance[1-10]: 5

Why: Adding explanatory comments for ignored error codes improves maintainability by making it clear why certain flake8 rules are disabled. While helpful for documentation, this is a moderate-impact suggestion focused on code clarity rather than functionality.

5

💡 Need additional feedback ? start a PR chat

@sandeepsuryaprasad
Copy link
Contributor Author

@VietND96 looks like some tests are failing which are not related to the change that i have made.. (Safari tests)

@VietND96 VietND96 merged commit d660af7 into SeleniumHQ:trunk Nov 13, 2024
13 of 15 checks passed
jkim2492 pushed a commit to jkim2492/selenium that referenced this pull request Nov 17, 2024
…Q#14749)

moved flake8 settings to tox.ini from setup.cfg
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.

3 participants