-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ruff update #3206
Ruff update #3206
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #3206 +/- ##
========================================
Coverage 93.14% 93.15%
========================================
Files 66 66
Lines 14248 14249 +1
========================================
+ Hits 13272 13273 +1
Misses 976 976 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just had a few questions:
- We should add a
.git-blame-ignore-revs
entry for the related commits like we did for boto3: Add .git-blame-ignore-revs boto3#4168 - I think we're making logging slightly inefficient by migrating onto fstrings. I'm not strongly against this since performance hit should be insignificant, but wanted to make sure this is a conscious change.
- Is there a reason for keeping isort?
I usually save these for follow up PRs since we have to change the commit every time we force push to this branch and if this gets squash merged we have to redo the hash as well. Those have been messed up enough that just keeping it as a post-release step has been most effective.
Hmm, good shout. So this is interesting, Jonas pointed out a minor perf improvement for using
I don't actually know why these got reformatted, but lines like this didn't: I can take a look at trying to manually move the first two lines back to the older format. Rewriting everything to the comma format by hand is likely not worth the minor performance difference imo.
I added a blip about that in the overview of the PR. The main issue is ruff does not have a way to ignore specific import lines only blocks. We have to keep isort for backwards compatibility at the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for the insight. I don't think that issue is worth blocking this PR. Approving
Can we add updates to botocore/CONTRIBUTING.rst? |
Yep, there are still a number of cleanup actions needed. The PR is still in draft to be added to as we go. I'll get everything finalized before putting it up for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
This is a follow up to boto/boto3#4161 to move our repos to use
ruff
in favor of our existingpre-commit
cocktail. For botocore, we have some unused imports that have been left in place due to third-party packages importing from modules importing from other modules.ruff
does not currently supply a way to comprehensively skip specific lines, only disabling sorting for entire import blocks. Because of this we've shut off sorting inruff
and will keepisort
in place for now.This should be largely inline with our existing configuration with some minor changes to fix f-string upgrades missed with our previous setup and some newline fixes. This PR keeps our existing quote preservation behavior until we get all projects moved to
ruff
. At that point, we can look at turning it to "double".