-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.pre-commit-config.yaml
127 lines (121 loc) · 3.69 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
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
# This one has been added to fail fast on syntax errors
# before running expensive pylint
- id: check-ast
types_or:
- python
- pyi
exclude: "/(site-packages|development-[^/]*|docs|node_modules|__pycache__|\\..*)/$"
- id: check-json
- id: check-yaml
types: [file]
files: \.(yaml|yml|wfex\.(stage|export|ctxt))$
- repo: https://github.com/koalaman/shellcheck-precommit.git
rev: v0.10.0
hooks:
- id: shellcheck
#args: [--format,json]
stages: [manual]
- repo: local
hooks:
- id: pylint
name: Local PyLint
language: system
require_serial: true
types:
- python
exclude: "^[^/]*env/|dev-[^/]*/|docs/"
entry: pylint
args: [-j , "4", --source-roots, .]
- id: mypy
name: Local MyPy
language: system
types_or:
- python
- pyi
exclude: "/(site-packages|development-[^/]*|docs|node_modules|__pycache__|\\..*)/$"
require_serial: true
entry: mypy
args: [--strict, --show-error-codes, --no-warn-unused-ignores]
- id: pip-audit-local
name: pip-audit over local environment
stages: [manual]
language: system
always_run: true
pass_filenames: false
require_serial: true
entry: pip-audit
args: []
## Main problem: python executable path, used to find the environment, is hardcoded
# - repo: https://github.com/pre-commit/mirrors-mypy.git
# rev: v1.10.0
# hooks:
# - id: mypy
# alias: mirrormypy
# exclude: "/(site-packages|development-[^/]*|docs|node_modules|__pycache__|\\..*)/$"
# require_serial: true
# entry: env PYTHONPATH=. mypy
# args: [--strict, --show-error-codes, --no-warn-unused-ignores, --python-executable, .full/bin/python]
# stages: [manual]
# - repo: meta
# hooks:
# - id: identity
# types:
# - python
# exclude: "/(site-packages|development-[^/]*|docs|node_modules|__pycache__|\\..*)/$"
# stages: [manual]
# - repo: https://github.com/pylint-dev/pylint.git
# rev: v3.2.0
# hooks:
# - id: pylint
# alias: mirrorpylint
# exclude: "^[^/]*env/|dev-[^/]*/"
# entry: env PYTHONPATH=. pylint
# args: [-j, "4", --source-roots, .]
# stages: [manual]
# - repo: meta
- repo: https://github.com/inab/python-extended-json-schema-validator.git
rev: v0.15.1
hooks:
# - id: identity
- id: jsonschema_dir_validate
name: Check jsonschema
types:
- json
files: ^wfexs_backend/schemas/.*\.json$
require_serial: true
pass_filenames: false
args: [ wfexs_backend/schemas ]
- repo: https://github.com/jmfernandez/pre-commit_mirrors-actionlint.git
rev: v1.7.1
hooks:
- id: actionlint
- repo: https://github.com/jmfernandez/pre-commit_mirrors-hadolint.git
rev: v2.12.0
hooks:
- id: hadolint
args: [ -t, warning]
- repo: https://github.com/ambv/black.git
rev: 23.3.0
hooks:
- id: black
name: black_apply
exclude: "^[^/]*env/|development-[^/]*/|docs/"
stages: [manual]
- id: black
exclude: "^[^/]*env/|development-[^/]*/|docs/"
args: [--diff, --check]
- repo: https://github.com/jmfernandez/citation-cff-checker.git
rev: v0.1.0
hooks:
- id: cff_ver_validate
- repo: https://github.com/pypa/pip-audit
rev: v2.7.3
hooks:
- id: pip-audit
stages: [manual]
args: ["-r", "requirements.txt"]