Skip to content

enh: add precommit information for contributors and pre-commit style #3063

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 3 commits into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
28 changes: 17 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Nipype

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

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]!

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

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

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

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

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


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

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

When opening a pull request, please use one of the following prefixes:
When opening a pull request, please use one of the following prefixes:


* **[ENH]** for enhancements
* **[FIX]** for bug fixes
* **[TST]** for new or updated tests
* **[DOC]** for new or updated documentation
* **[STY]** for stylistic changes
* **[REF]** for refactoring existing code
* **[ENH]** for enhancements
* **[FIX]** for bug fixes
* **[TST]** for new or updated tests
* **[DOC]** for new or updated documentation
* **[STY]** for stylistic changes
* **[REF]** for refactoring existing code

**5. Install pre-commit.**

[pre-commit](https://pre-commit.com/) is a git hook for running operations at commit time. To use it in
your environment, do `pip install pre-commit` following by `pre-cmmit install`
inside your source directory.

<br>
Pull requests should be submitted early and often (please don't mix too many unrelated changes within one PR)!
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).
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).
This tells the development team that your pull request is a "work-in-progress", and that you plan to continue working on it.

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