From b5c8d516e0a8b8138e84ae9e3956a0ca3b4dc401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20H=C3=B6chenberger?= Date: Tue, 26 Sep 2023 21:30:01 +0200 Subject: [PATCH] Add git pre-commit configuration --- .pre-commit-config.yaml | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..5cc0cfbac --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,42 @@ +repos: + - repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black + args: [--quiet] + + # Ruff mne + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.291 + hooks: + - id: ruff + name: ruff mne + files: ^mne/ + + # Ruff tutorials and examples + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.291 + hooks: + - id: ruff + name: ruff tutorials and examples + # D103: missing docstring in public function + # D400: docstring first line must end with period + args: ["--ignore=D103,D400"] + files: ^tutorials/|^examples/ + + # Codespell + - repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell + additional_dependencies: + - tomli + files: ^mne/|^doc/|^examples/|^tutorials/ + types_or: [python, bib, rst, inc] + + # yamllint + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.32.0 + hooks: + - id: yamllint + args: [--strict, -c, .yamllint.yml]