-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
69 lines (69 loc) · 2.2 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-ast
- id: debug-statements
- id: end-of-file-fixer
- repo: https://github.com/seantis/pre-commit-hooks
rev: v1.1.0
hooks:
- id: nocheckin
exclude: .pre-commit-config.yaml
- id: pt_structure
- repo: https://github.com/mondeja/pre-commit-po-hooks
rev: 'v1.7.3'
hooks:
- id: untranslated-messages
files: '\.po$'
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
types: [file]
files: '^(src|stubs|tests).*\.py'
additional_dependencies:
- flake8-bugbear==24.2.6
- flake8-comprehensions==3.14.0
- flake8-noqa==1.4.0
- flake8-pyi==24.1.0
- flake8-type-checking==2.9.1
- repo: local
hooks:
- id: system
name: bandit
entry: ./bandit.sh
language: system
# NOTE: We want this hook to always run, but exactly once
# instead of for every file. So we exclude all files
exclude: '.*'
always_run: true
pass_filenames: false
- id: system
name: mypy
entry: ./mypy.sh
language: system
# NOTE: We want this hook to always run, but exactly once
# instead of for every file. So we exclude all files
exclude: '.*'
always_run: true
pass_filenames: false
- id: system
name: check-setup-cfg
entry: |
bash -c 'FILES=$(git diff --cached --name-only);
echo "Debug - Files changed: $FILES";
if echo "$FILES" | grep "setup.cfg" > /dev/null; then
if echo "$FILES" | grep "requirements.txt" > /dev/null; then
echo "✅ setup.cfg and requirements.txt both modified - looks good!";
exit 0;
else
echo "⚠️ Warning: setup.cfg was modified but requirements.txt was not!";
echo "Did you run \"make compile\" to re-generate the requirements.txt?";
exit 1;
fi;
fi'
language: system
pass_filenames: false