-
Notifications
You must be signed in to change notification settings - Fork 85
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
chore: Run pyupgrade on codebase (3.6+) #1164
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
f0642e5
to
35708bc
Compare
for CI suggestions it looks like you're already using pre-commit so you can add this configuration there as for running in CI, I've been building https://pre-commit.ci -- if you're interested in the open-but-secret alpha you can set it up at https://results.pre-commit.ci otherwise if you want to stick to github actions there's https://github.com/pre-commit/action |
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.
Nice. @kratsg Can we also get all these "should be f-string" cases taken care of as well?
Codecov Report
@@ Coverage Diff @@
## master #1164 +/- ##
=======================================
Coverage 97.18% 97.18%
=======================================
Files 63 63
Lines 3663 3663
Branches 523 522 -1
=======================================
Hits 3560 3560
Misses 64 64
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Thanks @asottile! I've gone ahead and setup |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
uh hmmm that's interesting -- it's not supposed to double-update so I've got a bug to fix (the recursion detection appears broken!) |
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.
for more information, see https://pre-commit.ci
fixes TypeError: bad operand type for unary +: 'str'
Avoid SyntaxError: f-string expression part cannot include a backslash
* Add nbqa to pre-commit hooks - Apply nbqa-black and nbqa-pyupgrade * Add nbqa config options to pyproject.toml * Run nbqa over all notebooks * Add --py36-plus option as arg to pyupgrade pre-commit hook - Amends PR #1164
* Run pyupgrade --py36-plus on codebase * Add pyupgrade to pre-commit hooks * Add pre-commit.ci status badge to README * Use f-strings over format() as much as possible * Thanks to Anthony Sottile (@asottile) for pyupgrade and pre-commit.ci Co-authored-by: Matthew Feickert <[email protected]>
* Add nbqa to pre-commit hooks - Apply nbqa-black and nbqa-pyupgrade * Add nbqa config options to pyproject.toml * Run nbqa over all notebooks * Add --py36-plus option as arg to pyupgrade pre-commit hook - Amends PR scikit-hep#1164
Description
Run asottile/pyupgrade on our codebase. Not sure how to implement a CI/github actions for this (@asottile might have suggestions?)
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: