|
1 | 1 | exclude: ^(.*/data/.*)
|
2 | 2 |
|
3 | 3 | repos:
|
4 |
| -- repo: https://github.com/psf/black |
5 |
| - rev: 23.1.0 |
6 |
| - hooks: |
7 |
| - - id: black-jupyter |
| 4 | + # Strip outputs from notebooks |
| 5 | + - repo: https://github.com/kynan/nbstripout |
| 6 | + rev: "0.7.1" |
| 7 | + hooks: |
| 8 | + - id: nbstripout |
| 9 | + args: |
| 10 | + ["--extra-keys", "metadata.kernelspec metadata.language_info.version"] |
8 | 11 |
|
9 |
| -- repo: https://github.com/kynan/nbstripout |
10 |
| - rev: "0.6.1" |
11 |
| - hooks: |
12 |
| - - id: nbstripout |
13 |
| - args: ["--extra-keys", "metadata.kernelspec metadata.language_info.version"] |
| 12 | + # The rest of the checks are from: |
| 13 | + # https://github.com/scientific-python/cookie/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/.pre-commit-config.yaml |
14 | 14 |
|
15 |
| -- repo: https://github.com/pre-commit/pre-commit-hooks |
16 |
| - rev: v4.4.0 |
17 |
| - hooks: |
18 |
| - - id: check-added-large-files |
19 |
| - - id: check-case-conflict |
20 |
| - - id: check-merge-conflict |
21 |
| - - id: check-symlinks |
22 |
| - - id: check-yaml |
23 |
| - - id: debug-statements |
24 |
| - - id: end-of-file-fixer |
25 |
| - - id: mixed-line-ending |
26 |
| - - id: requirements-txt-fixer |
27 |
| - - id: trailing-whitespace |
| 15 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 16 | + rev: "v4.5.0" |
| 17 | + hooks: |
| 18 | + - id: check-added-large-files |
| 19 | + - id: check-case-conflict |
| 20 | + - id: check-merge-conflict |
| 21 | + - id: check-symlinks |
| 22 | + - id: check-yaml |
| 23 | + - id: debug-statements |
| 24 | + - id: end-of-file-fixer |
| 25 | + - id: mixed-line-ending |
| 26 | + - id: name-tests-test |
| 27 | + args: ["--pytest-test-first"] |
| 28 | + - id: requirements-txt-fixer |
| 29 | + - id: trailing-whitespace |
28 | 30 |
|
29 |
| -- repo: https://github.com/pre-commit/pygrep-hooks |
30 |
| - rev: v1.10.0 |
31 |
| - hooks: |
32 |
| - - id: python-check-blanket-noqa |
33 |
| - # - id: python-check-blanket-type-ignore |
34 |
| - - id: python-no-eval |
35 |
| - - id: python-use-type-annotations |
36 |
| - - id: rst-backticks |
37 |
| - - id: rst-directive-colons |
38 |
| - - id: rst-inline-touching-normal |
| 31 | + - repo: https://github.com/pre-commit/pygrep-hooks |
| 32 | + rev: "v1.10.0" |
| 33 | + hooks: |
| 34 | + - id: rst-backticks |
| 35 | + - id: rst-directive-colons |
| 36 | + - id: rst-inline-touching-normal |
39 | 37 |
|
40 |
| -- repo: https://github.com/PyCQA/isort |
41 |
| - rev: 5.12.0 |
42 |
| - hooks: |
43 |
| - - id: isort |
44 |
| - # args: ["-a", "from __future__ import annotations"] # Python 3.7+ |
| 38 | + # - repo: https://github.com/pre-commit/mirrors-prettier |
| 39 | + # rev: "v4.0.0-alpha.8" |
| 40 | + # hooks: |
| 41 | + # - id: prettier |
| 42 | + # types_or: [yaml, markdown, html, css, scss, javascript, json] |
| 43 | + # args: [--prose-wrap=always] |
45 | 44 |
|
46 |
| -- repo: https://github.com/asottile/pyupgrade |
47 |
| - rev: v3.3.1 |
48 |
| - hooks: |
49 |
| - - id: pyupgrade |
50 |
| - args: ["--py37-plus"] |
| 45 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 46 | + rev: "v0.2.1" |
| 47 | + hooks: |
| 48 | + - id: ruff |
| 49 | + args: ["--fix", "--show-fixes"] |
| 50 | + - id: ruff-format |
51 | 51 |
|
52 |
| -# - repo: https://github.com/hadialqattan/pycln |
53 |
| -# rev: v1.1.0 |
54 |
| -# hooks: |
55 |
| -# - id: pycln |
56 |
| -# args: [--config=pyproject.toml] |
| 52 | + # TODO: Enable type checking |
| 53 | + # - repo: https://github.com/pre-commit/mirrors-mypy |
| 54 | + # rev: "v1.8.0" |
| 55 | + # hooks: |
| 56 | + # - id: mypy |
| 57 | + # files: src|tests |
| 58 | + # args: [] |
| 59 | + # additional_dependencies: |
| 60 | + # - pytest |
57 | 61 |
|
58 |
| -- repo: https://github.com/asottile/yesqa |
59 |
| - rev: v1.4.0 |
60 |
| - hooks: |
61 |
| - - id: yesqa |
62 |
| - exclude: docs/conf.py |
63 |
| - additional_dependencies: &flake8_dependencies |
64 |
| - - flake8-bugbear |
65 |
| - - flake8-print |
| 62 | + - repo: https://github.com/codespell-project/codespell |
| 63 | + rev: "v2.2.6" |
| 64 | + hooks: |
| 65 | + - id: codespell |
66 | 66 |
|
67 |
| -- repo: https://github.com/pycqa/flake8 |
68 |
| - rev: 6.0.0 |
69 |
| - hooks: |
70 |
| - - id: flake8 |
71 |
| - exclude: docs/conf.py |
72 |
| - additional_dependencies: *flake8_dependencies |
| 67 | + - repo: https://github.com/shellcheck-py/shellcheck-py |
| 68 | + rev: "v0.9.0.6" |
| 69 | + hooks: |
| 70 | + - id: shellcheck |
73 | 71 |
|
74 |
| -# - repo: https://github.com/pre-commit/mirrors-mypy |
75 |
| -# rev: v0.930 |
76 |
| -# hooks: |
77 |
| -# - id: mypy |
78 |
| -# files: src |
79 |
| -# args: [--show-error-codes] |
| 72 | + - repo: local |
| 73 | + hooks: |
| 74 | + - id: disallow-caps |
| 75 | + name: Disallow improper capitalization |
| 76 | + language: pygrep |
| 77 | + entry: PyBind|Numpy|Cmake|CCache|Github|PyTest |
| 78 | + exclude: .pre-commit-config.yaml |
80 | 79 |
|
81 |
| -- repo: https://github.com/codespell-project/codespell |
82 |
| - rev: v2.2.2 |
83 |
| - hooks: |
84 |
| - - id: codespell |
| 80 | + - repo: https://github.com/abravalheri/validate-pyproject |
| 81 | + rev: "v0.16" |
| 82 | + hooks: |
| 83 | + - id: validate-pyproject |
| 84 | + additional_dependencies: ["validate-pyproject-schema-store[all]"] |
85 | 85 |
|
86 |
| -- repo: https://github.com/shellcheck-py/shellcheck-py |
87 |
| - rev: v0.9.0.2 |
88 |
| - hooks: |
89 |
| - - id: shellcheck |
90 |
| - |
91 |
| -- repo: local |
92 |
| - hooks: |
93 |
| - - id: disallow-caps |
94 |
| - name: Disallow improper capitalization |
95 |
| - language: pygrep |
96 |
| - entry: PyBind|Numpy|Cmake|CCache|Github|PyTest |
97 |
| - exclude: .pre-commit-config.yaml |
| 86 | + - repo: https://github.com/python-jsonschema/check-jsonschema |
| 87 | + rev: "0.28.0" |
| 88 | + hooks: |
| 89 | + - id: check-dependabot |
| 90 | + - id: check-github-workflows |
| 91 | + - id: check-readthedocs |
0 commit comments