-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
159 lines (142 loc) · 4.4 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Configuration file for pre-commit (https://pre-commit.com/).
# Please run `pre-commit run --all-files` when adding or changing entries.
repos:
- repo: local
hooks:
- id: alejandra
name: alejandra
entry: alejandra
files: \.nix$
language: system
stages: [commit]
# TODO: Reintroduce once https://github.com/NixOS/nixpkgs/pull/273831 is in use
# - id: check-github-workflows
# name: check-github-workflows
# description: Validate GitHub Workflows
# entry: check-jsonschema
# args: [--builtin-schema=vendor.github-workflows]
# files: ^\.github/workflows/[^/]+$
# types: [yaml]
# language: system
# stages: [commit]
- id: deadnix
name: deadnix
entry: deadnix
args: [--edit, --fail]
files: \.nix$
language: system
stages: [commit]
- id: gitlint
name: gitlint
entry: gitlint
args: [--staged, --msg-filename]
language: system
stages: [commit-msg]
- id: jupyter-clean
name: jupyter-clean
entry: jupyter
args:
[nbconvert, --clear-output, --ClearMetadataPreprocessor.enabled=True]
types: [jupyter]
language: system
stages: [commit]
- id: nbqa-black
name: nbqa-black
description: Run 'black' on Jupyter notebooks
entry: nbqa
args: [black]
require_serial: true
types_or: [jupyter, markdown]
language: system
stages: [commit]
- id: nbqa-isort
name: nbqa-isort
description: Run 'isort' on Jupyter notebooks
entry: nbqa
args: [isort]
require_serial: true
types_or: [jupyter, markdown]
language: system
stages: [commit]
- id: nbqa-mypy
name: nbqa-mypy
description: Run 'mypy' on Jupyter notebooks
entry: nbqa
args: [mypy]
require_serial: true
types_or: [jupyter, markdown]
language: system
stages: [commit]
- id: nbqa-pydocstyle
name: nbqa-pydocstyle
description: Run 'pydocstyle' on Jupyter notebooks
entry: nbqa
args: [pydocstyle]
require_serial: true
types_or: [jupyter, markdown]
language: system
stages: [commit]
- id: nbqa-pylint
name: nbqa-pylint
description: Run 'pylint' on Jupyter notebooks
entry: nbqa
args: [pylint, --include-naming-hint=y]
require_serial: true
types_or: [jupyter, markdown]
language: system
stages: [commit]
- id: pathchk
name: pathchk
entry: pathchk
args: [--portability]
types: [file]
exclude: ^([a-zA-Z0-9._][a-zA-Z0-9._-]+)(/[a-zA-Z0-9._][a-zA-Z0-9._-]+)*$ # https://lists.gnu.org/archive/html/coreutils/2023-01/msg00006.html
language: system
stages: [commit]
- id: prettier
name: prettier
entry: prettier
args: [--ignore-unknown, --list-different, --write]
types: [text]
language: system
stages: [commit]
- id: shellcheck
name: shellcheck
entry: shellcheck
types: [shell]
language: system
stages: [commit]
# TODO: Kill if https://github.com/pre-commit/identify/issues/350 is fixed
- id: shellcheck_other
name: shellcheck other
entry: shellcheck
files: ^\.envrc$
language: system
stages: [commit]
- id: shfmt
name: Format shell scripts
entry: shfmt
args: [--case-indent, --indent=4, --list, --space-redirects, --write]
types: [shell]
language: system
stages: [commit]
# TODO: Kill if https://github.com/pre-commit/identify/issues/350 is fixed
- id: shfmt_other
name: Format other shell scripts
entry: shfmt
args: [--case-indent, --indent=4, --list, --space-redirects, --write]
files: ^\.envrc$
language: system
stages: [commit]
- id: statix
name: statix
entry: statix
args: [check]
files: \.nix$
pass_filenames: false
language: system
stages: [commit]
# TODO: Re-enable when https://github.com/NixOS/nixpkgs/issues/270805 is fixed
# - repo: meta
# hooks:
# - id: check-useless-excludes