-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
150 lines (133 loc) · 4.03 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
---
repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
exclude: tests/.*$
# For IDE-integration outside of the pre-commit hook,
# see: https://black.readthedocs.io/en/stable/editor_integration.html
- repo: https://github.com/ambv/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/cruft/cruft
rev: 2.11.1
hooks:
- id: cruft
name: cruft
language: system
# Log status but always succeed, providing downstream project
# maintainers template synchronization discretion.
# see: https://stackoverflow.com/a/59745587
verbose: true
entry: bash -c 'cruft check || true' --
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
exclude: ^(poetry\.lock|\.cruft\.json)$
#
exclude_types: [jupyter]
#
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
name: hadolint
# Docstring coverage tool
- repo: https://github.com/econchick/interrogate
rev: 1.5.0
hooks:
- id: interrogate
args: [-vv, --config=pyproject.toml]
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: markdown-toc
args: [--maxdepth=3, -i]
exclude: ^(docs/source/.*)$
- repo: local
hooks:
- id: mypy
name: mypy
language: system
entry: .tox/precommit/bin/mypy
args: [--cache-dir=/dev/null, --config-file=pyproject.toml]
types: [python]
#
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.1
hooks:
- id: nbqa-black
- id: nbqa-ruff
- repo: local
hooks:
- id: nbqa-bandit
name: nbqa-bandit
description: "Run tox env `bandit` on a Jupyter Notebook"
entry: .tox/precommit/bin/nbqa bandit
language: system
types: [jupyter]
## Override nbqa pre-packaged hooks to preempt spurious "Module not found"
## errors
# See: https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
- repo: local
hooks:
- id: nbqa-mypy
name: nbqa-mypy
description: "Run tox env `mypy` on a Jupyter Notebook"
entry: .tox/precommit/bin/nbqa mypy
args: [--cache-dir=/dev/null, --config-file=pyproject.toml]
language: system
types: [jupyter]
#
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: script-must-have-extension
- id: script-must-not-have-extension
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.220
hooks:
- id: ruff
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.8.0
hooks:
- id: shellcheck
args:
- --external-sources
types: [shell]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.5.1-2
hooks:
- id: shfmt-docker # Docker image (requires Docker to run)
args:
# Formatting options based on Google's shell style guidelines
# see:
# - https://www.mankier.com/1/shfmt#Examples
# - https://www.mankier.com/1/shfmt#Options
- --binary-next-line
- --case-indent
- --indent=2
- --write
types: [shell]
- repo: https://github.com/adrienverge/yamllint
rev: v1.28.0
hooks:
- id: yamllint
args: ['-d {extends: default, rules: {line-length: {max: 120, level: warning}}}']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files # Ignored for git-lfs files
args: [--maxkb=100000] # 100MB
- id: check-ast
- id: debug-statements
- id: end-of-file-fixer # Ensure files ONLY end in a newline
exclude_types: [jupyter]
- id: pretty-format-json # Sort and indent
args: [--autofix]
exclude: ^(\.cruft\.json)$
- id: trailing-whitespace # Trim
args: [--markdown-linebreak-ext=md]