-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
155 lines (143 loc) · 4.02 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
repos:
###################################### Poetry ###################################
- repo: https://github.com/python-poetry/poetry
rev: 1.7.0
hooks:
- id: poetry-check
stages: [pre-commit]
- id: poetry-export
args: [-f, requirements.txt, -o, requirements.txt]
stages: [pre-commit]
- id: poetry-export
args: [--only=dev, -f, requirements.txt, -o, configs/dev/requirements.dev.txt]
stages: [pre-commit]
- id: poetry-export
args: [--only=test, -f, requirements.txt, -o, configs/dev/requirements.test.txt]
stages: [pre-commit]
###################################### Local ####################################
- repo: local
hooks:
- id: tox
name: tox test
entry: bash -c 'make runTests'
language: system
pass_filenames: false
stages: [pre-commit]
- id: docs
name: mkdocs
entry: bash -c 'make runDocs'
language: system
pass_filenames: false
stages: [pre-commit]
###################################### Default ###################################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# Identify invalid files
- id: check-ast
stages: [pre-commit]
- id: check-yaml
stages: [pre-commit]
- id: check-json
stages: [pre-commit]
- id: check-toml
stages: [pre-commit]
- id: pretty-format-json
args: [--autofix]
stages: [pre-commit]
# git checks
- id: check-merge-conflict
stages: [pre-commit]
- id: check-added-large-files
exclude: tests/media/.+
stages: [pre-commit]
- id: detect-private-key
stages: [pre-commit]
- id: check-case-conflict
stages: [pre-commit]
# General quality checks
- id: check-symlinks
stages: [pre-commit]
- id: check-executables-have-shebangs
stages: [pre-commit]
- id: check-shebang-scripts-are-executable
stages: [pre-commit]
- id: mixed-line-ending
stages: [pre-commit]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
stages: [pre-commit]
- id: end-of-file-fixer
exclude: requirements.txt
stages: [pre-commit]
###################################### Python ##################################
# Python checks
- id: check-builtin-literals
stages: [pre-commit]
- id: check-docstring-first
stages: [pre-commit]
- id: debug-statements
stages: [pre-commit]
- id: fix-byte-order-marker
stages: [pre-commit]
# python formatter
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
stages: [pre-commit]
# ruff linter
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.5
hooks:
- id: ruff
stages: [pre-commit]
# python mypy
- repo: local
hooks:
- id: mypy
name: mypy
language: system
types: [python]
entry: bash -c 'set -e; for file in "$@"; do make runPoetry CMD="mypy $file"; done' --
stages: [pre-commit]
# dead code
- repo: https://github.com/jendrikseipp/vulture
rev: v2.10
hooks:
- id: vulture
stages: [pre-commit]
###################################### INI/TOML/YAML ###########################
# ini formatter
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
hooks:
- id: pretty-format-ini
args: [--autofix]
stages: [pre-commit]
- id: pretty-format-toml
args: [--autofix]
stages: [pre-commit]
- id: pretty-format-yaml
args: [--autofix]
stages: [pre-commit]
###################################### SpellChecker ############################
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
stages: [pre-commit]
###################################### Shell ###################################
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
stages: [pre-commit]
###################################### GIT #####################################
- repo: https://github.com/commitizen-tools/commitizen
rev: 3.12.0
hooks:
- id: commitizen
stages: [commit-msg]