Skip to content

Commit f0a01b5

Browse files
authored
Merge pull request #3063 from satra/enh/precommit
enh: add precommit information for contributors and pre-commit style
2 parents cffb1f2 + 344c6ba commit f0a01b5

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v2.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/psf/black
12+
rev: 19.3b0
13+
hooks:
14+
- id: black

CONTRIBUTING.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to Nipype
22

3-
Welcome to the Nipype repository! We're excited you're here and want to contribute.
3+
Welcome to the Nipype repository! We're excited you're here and want to contribute.
44

55
These guidelines are designed to make it as easy as possible to get involved. If you have any questions that aren't discussed below, please let us know by opening an [issue][link_issues]!
66

@@ -72,7 +72,7 @@ One way to do this is to [configure a new remote named "upstream"](https://help.
7272

7373
**3. Make the changes you've discussed.**
7474

75-
If you're adding a new tool from an existing neuroimaging toolkit (e.g., 3dDeconvolve from AFNI),
75+
If you're adding a new tool from an existing neuroimaging toolkit (e.g., 3dDeconvolve from AFNI),
7676
check out the [guide for adding new interfaces to Nipype][link_new_interfaces].
7777

7878
When you are working on your changes, test frequently to ensure you are not breaking the existing code.
@@ -82,27 +82,33 @@ Before pushing your changes to GitHub, run `make check-before-commit`. This will
8282
test the entire package, and build the documentation.
8383
If you get no errors, you're ready to submit your changes!
8484

85-
It's a good practice to create [a new branch](https://help.github.com/articles/about-branches/)
85+
It's a good practice to create [a new branch](https://help.github.com/articles/about-branches/)
8686
of the repository for a new set of changes.
8787

8888

8989
**4. Submit a [pull request][link_pullrequest].**
9090

9191
A new pull request for your changes should be created from your fork of the repository.
9292

93-
When opening a pull request, please use one of the following prefixes:
93+
When opening a pull request, please use one of the following prefixes:
9494

9595

96-
* **[ENH]** for enhancements
97-
* **[FIX]** for bug fixes
98-
* **[TST]** for new or updated tests
99-
* **[DOC]** for new or updated documentation
100-
* **[STY]** for stylistic changes
101-
* **[REF]** for refactoring existing code
96+
* **[ENH]** for enhancements
97+
* **[FIX]** for bug fixes
98+
* **[TST]** for new or updated tests
99+
* **[DOC]** for new or updated documentation
100+
* **[STY]** for stylistic changes
101+
* **[REF]** for refactoring existing code
102+
103+
**5. Install pre-commit.**
104+
105+
[pre-commit](https://pre-commit.com/) is a git hook for running operations at commit time. To use it in
106+
your environment, do `pip install pre-commit` following by `pre-commit install`
107+
inside your source directory.
102108

103109
<br>
104110
Pull requests should be submitted early and often (please don't mix too many unrelated changes within one PR)!
105-
If your pull request is not yet ready to be merged, please also include the **[WIP]** prefix (you can remove it once your PR is ready to be merged).
111+
If your pull request is not yet ready to be merged, please also include the **[WIP]** prefix (you can remove it once your PR is ready to be merged).
106112
This tells the development team that your pull request is a "work-in-progress", and that you plan to continue working on it.
107113

108114
Review and discussion on new code can begin well before the work is complete, and the more discussion the better!

0 commit comments

Comments
 (0)