Diff of /.pre-commit-config.yaml [000000] .. [7f9fb8]

Switch to unified view

a b/.pre-commit-config.yaml
1
repos:
2
  # Ruff mne
3
  - repo: https://github.com/astral-sh/ruff-pre-commit
4
    rev: v0.11.5
5
    hooks:
6
      - id: ruff
7
        name: ruff lint mne
8
        args: ["--fix"]
9
        files: ^mne/|^tools/
10
        exclude: vulture_allowlist.py
11
      - id: ruff
12
        name: ruff lint mne preview
13
        args: ["--fix", "--preview", "--select=NPY201"]
14
        files: ^mne/|^tools/
15
      - id: ruff
16
        name: ruff lint doc, tutorials, and examples
17
        # D103: missing docstring in public function
18
        # D400: docstring first line must end with period
19
        args: ["--ignore=D103,D400", "--fix"]
20
        files: ^doc/|^tutorials/|^examples/
21
      - id: ruff-format
22
        files: ^mne/|^doc/|^tutorials/|^examples/|^tools/
23
24
  # Codespell
25
  - repo: https://github.com/codespell-project/codespell
26
    rev: v2.4.1
27
    hooks:
28
      - id: codespell
29
        additional_dependencies:
30
          - tomli
31
        files: ^mne/|^doc/|^examples/|^tutorials/|^tools/
32
        types_or: [python, bib, rst, inc]
33
34
  # yamllint
35
  - repo: https://github.com/adrienverge/yamllint.git
36
    rev: v1.37.0
37
    hooks:
38
      - id: yamllint
39
        args: [--strict, -c, .yamllint.yml]
40
41
  # rstcheck
42
  - repo: https://github.com/rstcheck/rstcheck.git
43
    rev: v6.2.4
44
    hooks:
45
      - id: rstcheck
46
        additional_dependencies:
47
          - tomli
48
        files: ^doc/.*\.(rst|inc)$
49
        # Credit is problematic because we generate an include on the fly
50
        exclude: ^doc/credit.rst$
51
52
  # sorting
53
  - repo: https://github.com/pre-commit/pre-commit-hooks
54
    rev: v5.0.0
55
    hooks:
56
      - id: file-contents-sorter
57
        files: ^doc/changes/names.inc|^.mailmap
58
        args: ["--ignore-case"]
59
60
  - repo: https://github.com/pappasam/toml-sort
61
    rev: v0.24.2
62
    hooks:
63
      - id: toml-sort-fix
64
        files: pyproject.toml
65
66
  # dependencies
67
  - repo: local
68
    hooks:
69
      - id: update-env-file
70
        name: Copy dependency changes from pyproject.toml to environment.yml
71
        language: python
72
        entry: ./tools/hooks/update_environment_file.py
73
        files: '^(pyproject.toml|tools/hooks/update_environment_file.py)$'
74
  - repo: local
75
    hooks:
76
      - id: dependency-sync
77
        name: Copy core dependencies from pyproject.toml to README.rst
78
        language: python
79
        entry: ./tools/hooks/sync_dependencies.py
80
        files: '^(pyproject.toml|tools/hooks/sync_dependencies.py)$'
81
        additional_dependencies: ["mne==1.9.0"]
82
83
  # zizmor
84
  - repo: https://github.com/woodruffw/zizmor-pre-commit
85
    rev: v1.5.2
86
    hooks:
87
      - id: zizmor
88
89
# these should *not* be run on CIs:
90
ci:
91
  skip: [dependency-sync]  # needs MNE to work, which exceeds the free tier space alloc.
92
93
# The following are too slow to run on local commits, so let's only run on CIs:
94
#
95
#   - repo: https://github.com/pre-commit/mirrors-mypy
96
#     rev: v1.9.0
97
#     hooks:
98
#       - id: mypy
99
#
100
#   - repo: https://github.com/jendrikseipp/vulture
101
#     rev: 'v2.11'  # or any later Vulture version
102
#     hooks:
103
#       - id: vulture