From 9b69c137035993e365140c03d4c2f6547a2984e5 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Thu, 3 Oct 2019 20:31:47 -0400 Subject: [PATCH 1/3] enh: add precommit information for contributors and pre-commit style --- .pre-commit-config.yaml | 14 ++++++++++++++ CONTRIBUTING.md | 28 +++++++++++++++++----------- 2 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..c429bfa6d9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f55c09a41c..e47cabf282 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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]! @@ -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. @@ -82,7 +82,7 @@ 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. @@ -90,19 +90,25 @@ of the repository for a new set of changes. 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]() 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.
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! From 254b0a394a95d4366525bdcaef5088ac7540c8e4 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Thu, 3 Oct 2019 20:34:06 -0400 Subject: [PATCH 2/3] doc: add pre-commit url --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e47cabf282..9f9a4dcb31 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -102,7 +102,7 @@ When opening a pull request, please use one of the following prefixes: **5. Install pre-commit.** -[pre-commit]() is a git hook for running operations at commit time. To use it in +[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. From 344c6bab51c1bba09496c26c9c11019dfb2dee66 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Mon, 7 Oct 2019 09:26:09 -0400 Subject: [PATCH 3/3] Update CONTRIBUTING.md Co-Authored-By: Chris Markiewicz --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f9a4dcb31..331cdd88fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -103,7 +103,7 @@ When opening a pull request, please use one of the following prefixes: **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` +your environment, do `pip install pre-commit` following by `pre-commit install` inside your source directory.