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]: new tox recipe for isort #11005

Merged
merged 8 commits into from Sep 30, 2022
Merged

[py]: new tox recipe for isort #11005

merged 8 commits into from Sep 30, 2022

Conversation

symonk
Copy link
Member

@symonk symonk commented Sep 4, 2022

I hope to break these kind of changes down into single changes; for now a lot of proof of concept ideas. Here is a new tox recipe used via tox -e isort that keeps our imports PEP compliant and consistent. This buys us:

  • Consistent code base
  • Organised imports for free
  • Less merge conflicts

This uses isort a very popular import linter and for now is entirely opt in via tox -e isort which at present only covers the test/ directory; I'd like to expand it across selenium/ also once we are happy with it as a POC. I want to bolt on some other stuff as well which will be somewhat similar.

If you like it i will follow up PRs with additional tooling to help us improve our contributing UX and general code consistency. Eventually we will look at enforcing the new recipes (including the existing flake8 stuff) through a tox -e linting 'parent', but for now let's be opt in to avoid any teething issues.

Thanks

This is a sub part of #10761

edit: This was open for a while, I went ahead and applied it over selenium/ & tests/

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2022

Codecov Report

Base: 52.63% // Head: 53.28% // Increases project coverage by +0.65% 🎉

Coverage data is based on head (b063faf) compared to base (316f973).
Patch coverage: 95.88% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #11005      +/-   ##
==========================================
+ Coverage   52.63%   53.28%   +0.65%     
==========================================
  Files          81       81              
  Lines        5388     5472      +84     
  Branches      270      270              
==========================================
+ Hits         2836     2916      +80     
- Misses       2282     2286       +4     
  Partials      270      270              
Impacted Files Coverage Δ
py/selenium/common/__init__.py 100.00% <ø> (ø)
py/selenium/types.py 100.00% <ø> (ø)
py/selenium/webdriver/chromium/service.py 76.92% <ø> (ø)
...lenium/webdriver/common/actions/pointer_actions.py 20.48% <ø> (ø)
py/selenium/webdriver/common/log.py 26.47% <ø> (ø)
py/selenium/webdriver/common/timeouts.py 91.11% <ø> (ø)
py/selenium/webdriver/firefox/firefox_profile.py 32.70% <ø> (ø)
...lenium/webdriver/support/event_firing_webdriver.py 33.60% <ø> (ø)
py/selenium/webdriver/webkitgtk/service.py 36.36% <ø> (ø)
py/selenium/webdriver/wpewebkit/service.py 36.36% <ø> (ø)
... and 46 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@symonk symonk changed the title [py]: Implement a linter for python imports using tox [py]: new tox recipe for isort Sep 13, 2022
@symonk symonk merged commit 3167e93 into trunk Sep 30, 2022
@symonk symonk deleted the isort-across-tests-dir branch September 30, 2022 17:00
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.

None yet

3 participants