-
Notifications
You must be signed in to change notification settings - Fork 258
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
STY: Normalize to blue and isort #1124
Conversation
Codecov ReportBase: 92.38% // Head: 92.38% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1124 +/- ##
=======================================
Coverage 92.38% 92.38%
=======================================
Files 98 98
Lines 12264 12257 -7
Branches 2520 2520
=======================================
- Hits 11330 11324 -6
+ Misses 613 612 -1
Partials 321 321
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. |
13d8a15
to
06aa591
Compare
In the absence of feedback, I plan to push on this as time allows and merge when satisfied. |
3e22a51
to
2eceee6
Compare
How do you feel about specifying: [flake8]
...
per-file-ignores =
*/__init__.py: F401 for init files? Or are there other codes we should be ignoring? Otherwise, I think it would be great to move forward with this. We can always revert changes in particular files or sections if we find it less readable, and hopefully at some point we will be able to update |
2eceee6
to
5165465
Compare
5165465
to
58f9f97
Compare
Run with a custom patch to avoid realigning inline comments: pipx run --spec git+https://github.com/effigies/blue.git@fix/hanging-comments blue nibabel [git-blame-ignore-rev]
[git-blame-ignore-rev]
bd4d8fc
to
f1a85f8
Compare
[git-blame-ignore-rev]
Add fmt off/on guards for tabular comments [git-blame-ignore-rev]
Mostly motivated by excessive use of arguments to super(). Also caught a number of `np.array(X).astype(Y)` to convert to `np.array(X, Y)`. [git-blame-ignore-rev]
[git-blame-ignore-rev]
f1a85f8
to
69785cd
Compare
Let's break all the PRs... |
Looking at #1114, I think we're past the days of asking people to follow style guides. Code formatters have gotten a lot better in the last decade, and it makes more sense to just give people the configuration to auto-format.
Here I'm proposing we use blue, which is like black but doesn't insist on double-quotes everywhere.
I'm also suggesting isort just because I've seen a number of PRs where people's editors auto-sort imports for them, so let's just tell their editors what to do.
The style config becomes:
There are some things I want to revert and protect from re-formatting, most notably the NIfTI intent recoder. But on the whole I find very little objectionable and some things look noticeably better. Any objections / other things to revert and protect?