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
49 changed files with 195 additions and 145 deletions

View file

@ -10,7 +10,7 @@ body:
attributes:
value: |
Fill in this form if you want that junifer includes a new dataset.
As a reminder, junifer supports customising the `PatternDataGrabber` and `PatternDataladDatagrabber` which should work in most cases.
If it is a widely used dataset, we could alternatevely create a new _DataGrabber_ that simplifies the usage, by already configuring the underlying `PatternDataGrabber` or `PatternDataladDatagrabber`

View file

@ -47,4 +47,4 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: docs
if: success() && matrix.python-version == 3.10
if: success() && matrix.python-version == 3.10

2
.gitignore vendored
View file

@ -134,4 +134,4 @@ cython_debug/
junifer/_version.py
scratch/
junifer_jobs/
junifer_jobs/

48
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,48 @@
ci:
autofix_prs: false
autoupdate_commit_msg: "chore: bump pre-commit repositories"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-yaml
- id: check-toml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.2
hooks:
- id: validate-pyproject
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
exclude: ^(docs/|examples/|tools/)
args: [--check]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.267
hooks:
- id: ruff
exclude: ^(__init__.py)
args: [--format, grouped, --show-fixes]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
exclude: ^(.github/|docs/)
args: [--config, tox.ini]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-no-eval
- id: python-no-log-warn
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

View file

@ -648,4 +648,4 @@ specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a “copyright disclaimer” for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
&lt;<http://www.gnu.org/licenses/>&gt;.
&lt;<http://www.gnu.org/licenses/>&gt;.

View file

@ -10,6 +10,7 @@
![Codecov](https://img.shields.io/codecov/c/github/juaml/junifer?style=flat-square)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
## About

View file

@ -36,4 +36,4 @@ flag_management:
threshold: 1%
- type: patch
target: 95%
threshold: 1%
threshold: 1%

View file

@ -22,7 +22,7 @@ clean:
local: news
make _build_local; STATUS=$$?; make news_cleanup; exit $$STATUS
news:
news:
@echo "Generating whats_new.rst"
cd ../ && towncrier build --keep

View file

@ -43,4 +43,4 @@ body:not([data-theme="light"]) .mermaid svg .edgeLabel {
body:not([data-theme="light"]) .mermaid svg .marker{
stroke: white !important;
fill: white !important;
}
}

View file

@ -11,4 +11,4 @@ for (i = 0; i < coll.length; i++) {
content.style.display = "block";
}
});
}
}

View file

@ -2,7 +2,7 @@
<div class="sidebar-tree">
<p class="version-select">
<span class="caption-text">Other Versions</span>
</p>
</p>
<div id="versions">
{% if versions.branches %}
<span class="caption-text">{{ _('Branches') }}</span>

View file

@ -41,8 +41,8 @@ Configs
External
--------
.. toctree::
.. toctree::
:maxdepth: 2
:caption: Contents:
nilearn.rst
nilearn.rst

View file

@ -1 +1 @@
!.gitignore
!.gitignore

View file

@ -1 +1 @@
Improve general prose, formatting and code blocks in docs and set line length for ``.rst`` files to 80 by `Synchon Mandal`_
Improve general prose, formatting and code blocks in docs and set line length for ``.rst`` files to 80 by `Synchon Mandal`_

View file

@ -1 +1 @@
Rename ``junifer.testing.datagrabbers.SPMAuditoryTestingDatagrabber`` to :class:`.SPMAuditoryTestingDataGrabber` and ``junifer.testing.datagrabbers.OasisVBMTestingDatagrabber`` to :class:`.OasisVBMTestingDataGrabber` by `Synchon Mandal`_
Rename ``junifer.testing.datagrabbers.SPMAuditoryTestingDatagrabber`` to :class:`.SPMAuditoryTestingDataGrabber` and ``junifer.testing.datagrabbers.OasisVBMTestingDatagrabber`` to :class:`.OasisVBMTestingDataGrabber` by `Synchon Mandal`_

View file

@ -1 +1 @@
Rename instances of "Datagrabber" to "DataGrabber" especially in ``junifer.testing`` to be consistent by `Synchon Mandal`_
Rename instances of "Datagrabber" to "DataGrabber" especially in ``junifer.testing`` to be consistent by `Synchon Mandal`_

View file

@ -1 +1 @@
Enable YAML 1.2 support and allow multiline strings in YAML which would not work earlier by `Synchon Mandal`_
Enable YAML 1.2 support and allow multiline strings in YAML which would not work earlier by `Synchon Mandal`_

View file

@ -1 +1 @@
Use ``ruamel.yaml`` instead of ``pyyaml`` as YAML I/O library by `Synchon Mandal`_
Use ``ruamel.yaml`` instead of ``pyyaml`` as YAML I/O library by `Synchon Mandal`_

View file

@ -1 +1 @@
Adopt ``ruff`` as the only linter for the codebase by `Synchon Mandal`_
Adopt ``ruff`` as the only linter for the codebase by `Synchon Mandal`_

View file

@ -0,0 +1 @@
Adopt ``pre-commmit`` for adding and managing git pre-commit hooks by `Synchon Mandal`_

Some files were not shown because too many files have changed in this diff Show more