Skip to content

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

Merged
merged 10 commits into from
Sep 27, 2022

Conversation

mgxd
Copy link
Collaborator

@mgxd mgxd commented Sep 22, 2022

Adds pre-commit hooks for styling to repo, which can be leveraged after running pre-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.

@mgxd mgxd marked this pull request as ready for review September 22, 2022 21:37
@mgxd mgxd self-assigned this Sep 23, 2022
Copy link
Member

@effigies effigies left a 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]
Copy link
Member

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.

Suggested change
python-version: [3.9]
python-version: [3]

Comment on lines 14 to 22
# 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):
Copy link
Member

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
Copy link
Member

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]>
@effigies
Copy link
Member

@mgxd Canceled the circle build. Please restart if you think it should be run all the way through.

@mgxd mgxd merged commit ac44a3a into nipreps:master Sep 27, 2022
@mgxd mgxd deleted the sty/pre-commit branch September 27, 2022 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

2 participants