-
Notifications
You must be signed in to change notification settings - Fork 305
MAINT: Add pre-commit
, dev installation for consistent styling
#2857
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
de58c23
to
5fa4f69
Compare
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. Some suggestions and also I think I spotted a bug, but please have a look.
@@ -23,19 +23,20 @@ jobs: | |||
python-version: [3.9] |
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.
No need to pick a specific version for this. One less thing to periodically review.
python-version: [3.9] | |
python-version: [3] |
# Silence PyBIDS warning for extension entity behavior | ||
# Can be removed once minimum PyBIDS dependency hits 0.14 | ||
try: | ||
from packaging.version import Version | ||
import bids | ||
from packaging.version import Version | ||
|
||
if Version(bids.__version__) < Version('0.14'): | ||
bids.config.set_option('extension_initial_dot', True) | ||
except (ImportError, ValueError): |
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.
We should remove this block, since minimum pybids is 0.15. Can do it in a separate PR, if you want to keep this one tight.
lut[255] = 4 if nifti else 0 # Cerebellum | ||
lut[30:99] = 2 if nifti else 0 # dGM | ||
lut[1:11] = 3 if nifti else 1 # WM+CSF | ||
lut[255] = 4 if nifti else 0 # Cerebellum |
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 one place where I really hate black.
Co-authored-by: Chris Markiewicz <[email protected]>
@mgxd Canceled the circle build. Please restart if you think it should be run all the way through. |
Adds
pre-commit
hooks for styling to repo, which can be leveraged after runningpre-commit install
at the project root.Also runs another round of styling across the repo, with the addition of
# fmt:on/off
comments before/after nipype workflow connect statements.