update: add support for pre-commit #232

Merged
synchon merged 10 commits from enh/pre-commit into main 2023-06-21 10:48:42 +00:00
synchon commented 2023-05-22 16:09:38 +00:00 (Migrated from github.com)
  • description of feature/fix
  • tests added/passed
  • add an entry for the latest changes

This PR adds support for pre-commit in the codebase and makes necessary changes to adopt it.

* [x] description of feature/fix * [x] tests added/passed * [x] add an entry for the latest changes This PR adds support for `pre-commit` in the codebase and makes necessary changes to adopt it.
codecov[bot] commented 2023-05-22 16:12:09 +00:00 (Migrated from github.com)

Codecov Report

Merging #232 (e3c3792) into main (02a14ad) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head e3c3792 differs from pull request most recent head d031615. Consider uploading reports for the commit d031615 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
- Coverage   93.62%   93.61%   -0.01%     
==========================================
  Files          82       82              
  Lines        3464     3460       -4     
  Branches      644      644              
==========================================
- Hits         3243     3239       -4     
  Misses        144      144              
  Partials       77       77              
Flag Coverage Δ
docs 100.00% <ø> (ø)
junifer 93.61% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
docs/conf.py 100.00% <ø> (ø)
junifer/api/cli.py 69.14% <ø> (ø)
junifer/data/masks.py 96.42% <ø> (-0.04%) ⬇️
...r/external/nilearn/junifer_nifti_spheres_masker.py 93.33% <ø> (-0.08%) ⬇️
junifer/markers/reho/reho_estimator.py 68.70% <ø> (ø)
junifer/storage/pandas_base.py 95.55% <ø> (ø)
junifer/api/functions.py 96.23% <100.00%> (ø)
junifer/api/parser.py 94.87% <100.00%> (ø)
junifer/data/coordinates.py 100.00% <100.00%> (ø)
junifer/data/parcellations.py 98.08% <100.00%> (-0.01%) ⬇️
... and 19 more
## [Codecov](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report > Merging [#232](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) (e3c3792) into [main](https://app.codecov.io/gh/juaml/junifer/commit/02a14ad3a9642b704afdcdf3bcbe8461e027dc99?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) (02a14ad) will **decrease** coverage by `0.01%`. > The diff coverage is `100.00%`. > :exclamation: Current head e3c3792 differs from pull request most recent head d031615. Consider uploading reports for the commit d031615 to get more accurate results [![Impacted file tree graph](https://app.codecov.io/gh/juaml/junifer/pull/232/graphs/tree.svg?width=650&height=150&src=pr&token=5H21JuZXMw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #232 +/- ## ========================================== - Coverage 93.62% 93.61% -0.01% ========================================== Files 82 82 Lines 3464 3460 -4 Branches 644 644 ========================================== - Hits 3243 3239 -4 Misses 144 144 Partials 77 77 ``` | Flag | Coverage Δ | | |---|---|---| | docs | `100.00% <ø> (ø)` | | | junifer | `93.61% <100.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [docs/conf.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-ZG9jcy9jb25mLnB5) | `100.00% <ø> (ø)` | | | [junifer/api/cli.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9hcGkvY2xpLnB5) | `69.14% <ø> (ø)` | | | [junifer/data/masks.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL21hc2tzLnB5) | `96.42% <ø> (-0.04%)` | :arrow_down: | | [...r/external/nilearn/junifer\_nifti\_spheres\_masker.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9leHRlcm5hbC9uaWxlYXJuL2p1bmlmZXJfbmlmdGlfc3BoZXJlc19tYXNrZXIucHk=) | `93.33% <ø> (-0.08%)` | :arrow_down: | | [junifer/markers/reho/reho\_estimator.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL3JlaG8vcmVob19lc3RpbWF0b3IucHk=) | `68.70% <ø> (ø)` | | | [junifer/storage/pandas\_base.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9zdG9yYWdlL3BhbmRhc19iYXNlLnB5) | `95.55% <ø> (ø)` | | | [junifer/api/functions.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9hcGkvZnVuY3Rpb25zLnB5) | `96.23% <100.00%> (ø)` | | | [junifer/api/parser.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9hcGkvcGFyc2VyLnB5) | `94.87% <100.00%> (ø)` | | | [junifer/data/coordinates.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL2Nvb3JkaW5hdGVzLnB5) | `100.00% <100.00%> (ø)` | | | [junifer/data/parcellations.py](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9kYXRhL3BhcmNlbGxhdGlvbnMucHk=) | `98.08% <100.00%> (-0.01%)` | :arrow_down: | | ... and [19 more](https://app.codecov.io/gh/juaml/junifer/pull/232?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | |
github-actions[bot] commented 2023-05-22 16:16:03 +00:00 (Migrated from github.com)
PR Preview Action v1.4.4
Preview removed because the pull request was closed.
2023-06-21 10:53 UTC
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) v1.4.4 :---: Preview removed because the pull request was closed. 2023-06-21 10:53 UTC <!-- Sticky Pull Request Commentpr-preview -->
fraimondo commented 2023-06-20 10:23:59 +00:00 (Migrated from github.com)

can you explain what's the goal behind this PR?

can you explain what's the goal behind this PR?
synchon commented 2023-06-21 06:15:59 +00:00 (Migrated from github.com)

can you explain what's the goal behind this PR?

It enables the use of Git hooks specifically pre-commit via https://pre-commit.com . The pre-commit checks include everything from spellcheck to linting thus reducing the need for separate lint or spell-check commits and making contribution easy.

> can you explain what's the goal behind this PR? It enables the use of [Git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) specifically `pre-commit` via https://pre-commit.com . The pre-commit checks include everything from spellcheck to linting thus reducing the need for separate lint or spell-check commits and making contribution easy.
fraimondo commented 2023-06-21 07:08:00 +00:00 (Migrated from github.com)

Is this optional? Or it will not allow to commit if something is off?

Is this _optional_? Or it will not allow to commit if something is off?
synchon commented 2023-06-21 08:48:41 +00:00 (Migrated from github.com)

Is this optional? Or it will not allow to commit if something is off?

Once you do pre-commit install, it becomes mandatory. If you want to bypass a commit, you need to pass --no-verify flag to git commit. The docs include the instructions.

> Is this _optional_? Or it will not allow to commit if something is off? Once you do `pre-commit install`, it becomes mandatory. If you want to bypass a commit, you need to pass `--no-verify` flag to `git commit`. The docs include the instructions.
fraimondo commented 2023-06-21 08:51:45 +00:00 (Migrated from github.com)

perfect!

Fix conflicts and LGTM

perfect! Fix conflicts and LGTM
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer!232
No description provided.