-
Notifications
You must be signed in to change notification settings - Fork 266
STY: Old formatting to f-strings (PEP-498) #919
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
Conversation
%, '{}'.format -> f'{}' F-strings are supported from py3.6 which is nibabel's minimal python version (up-to-date). Was done with: https://github.com/ikamensh/flynt Excluding versioneer.py First commit changes were reviewed manually
Codecov Report
@@ Coverage Diff @@
## master #919 +/- ##
==========================================
+ Coverage 91.73% 91.85% +0.12%
==========================================
Files 97 96 -1
Lines 12357 12344 -13
Branches 2177 2176 -1
==========================================
+ Hits 11336 11339 +3
+ Misses 684 674 -10
+ Partials 337 331 -6
Continue to review full report at Codecov.
|
flynt -ll 999 . All changes were reviewed manually
flynt -ll 999 . All changes were reviewed manually (Excluding versioneer)
Excluding URLs which cannot be split and test code
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.
Thanks for this! I haven't finished reading through (~30 files to go), but I've made a number of comments that you might find useful before I have time to finish.
Feel free to push back on things that seem unreasonable, by the way.
One additional thing: Let's not touch externals/
or _version.py
. externals
are intended to be exact copies of an externally sourced module, except when they produce warnings or errors, and this isn't a necessary change. Similarly, _version.py
is generated by versioneer, and any changes we make can be potentially reverted, so switching it to f-strings
means more things to pay attention to if it ever needs to be regenerated.
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.
Reviewed again, before accepting all suggestions and adding mine
Co-authored-by: Chris Markiewicz <[email protected]>
+ remove str calls in f-strings, one line if possible
I cannot exactly understand CI failure: |
Travis sometimes glitches. I've restarted the job. We'll see if it repeats. |
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.
Thanks for your patience. I've had a chance to look through it all now. Just some small nitpicks.
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
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.
Reviewed comments
Thanks! |
%, '{}'.format -> f'{}'
F-strings are supported from py3.6 which is nibabel's minimal python version (up-to-date).
https://github.com/ikamensh/flynt