Skip to content
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

Add pre-commit to automatically fix style issue before pushing commits #973

Merged
merged 4 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
11 changes: 7 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,12 @@ For additional, in-depth information on contributing to `tedana`, please see our
Docstrings should follow [numpydoc][link_numpydoc] convention.
We encourage extensive documentation.

The Python code itself should follow [PEP8][link_pep8] convention,
with at most about 500 lines of code (not including docstrings) per script.
We use [black][link_black] and [isort][link_isort] to enforce this code style,
and we strongly recommend running both tools on your fork before opening a pull request.
The Python code itself should follow [PEP8][link_pep8] convention, with at most about 500 lines of
code (not including docstrings) per script. We use [black][link_black] and [isort][link_isort] to
enforce this code style, and we strongly recommend running both tools on your fork before opening a
pull request. We use [pre-commit][link_precommit] to automatically fix style issues when commit is
pushed rather than making contributors try to figure out why a contribution is out of compliance
with the style guides.
eurunuela marked this conversation as resolved.
Show resolved Hide resolved

Additionally, we have adopted a primarily functional approach in `tedana`,
so we avoid defining our own classes within the library unless absolutely necessary.
Expand Down Expand Up @@ -376,6 +378,7 @@ You're awesome. :wave::smiley:
[link_pep8]: https://www.python.org/dev/peps/pep-0008/
[link_black]: https://black.readthedocs.io/en/stable/
[link_isort]: https://pycqa.github.io/isort/
[link_precommit]: https://pre-commit.com/
[link_rst_guide]: http://docs.sphinxdocs.com/en/latest/step-1.html

[link_contributors]: https://github.com/ME-ICA/tedana/graphs/contributors
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Documentation = "https://www.tedana.readthedocs.io"
Paper = "https://joss.theoj.org/papers/10.21105/joss.03669"

[project.optional-dependencies]
dev = ["pre-commit"]
doc = [
"sphinx>=6.2.1",
"sphinx_copybutton",
Expand All @@ -59,7 +60,7 @@ tests = [
]

# Aliases
all = ["tedana[doc,tests]"]
all = ["tedana[dev,doc,tests]"]

[project.scripts]
ica_reclassify = "tedana.workflows.ica_reclassify:_main"
Expand Down