-
Notifications
You must be signed in to change notification settings - Fork 43
/
.pre-commit-config.yaml
94 lines (90 loc) · 2.21 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
# Bare minimum
# pre-commit will only ever lint files which are checked into your git repository, so the laundry list of exclusion
# is unnecessary here (.git / .mypy_cache / etc.)
# https://stackoverflow.com/questions/61032281/exclude-some-files-on-running-black-using-pre-commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
args: ['--maxkb=100000']
- id: check-docstring-first
- id: check-merge-conflict
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-ast
- id: detect-private-key
- id: fix-encoding-pragma
# Prevent pushes to 'master' and 'main' branch by default
# - id: no-commit-to-branch
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
# Mainly relevant for production code
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.239'
hooks:
- id: ruff
args:
- --fix
- --select
- F401
- F402
- F403
- F504
- F522
- F541
- F601
- F602
- F631
- F632
- F701
- F702
- F704
- F706
- F821
- F841
- F901
- E711
- E712
- E713
- E714
- E721
- E722
- W292
- W605
- I001
- I002
- N805
# - D100
- D101
- D102
- D103
- D104
- D200
- D201
- D207
- D208
- D209
- D211
- D213
- D214
- D215
- D403
- D405
- D414
- D419
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
# args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8