-
Notifications
You must be signed in to change notification settings - Fork 46
/
.pre-commit-config.yaml
158 lines (158 loc) · 4.24 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
156
157
158
# Update all versions in this file by running:
# $ pre-commit autoupdate
minimum_pre_commit_version: 2.19.0
default_language_version:
python: python3.9
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: end-of-file-fixer
name: Check for a blank line at the end of scripts (auto-fixes)
exclude: ^solutions/
- id: trailing-whitespace
- id: check-builtin-literals
exclude: |
(?x)^(
solutions/01_04.py|
solutions/02_21.py|
solutions/04_05.py|
solutions/05_01.py|
solutions/05_12.py
)$
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: debug-statements
exclude: |
(?x)^(
solutions/01_04.py|
solutions/02_21.py|
solutions/04_05.py|
solutions/05_01.py|
solutions/05_12.py
)$
- id: detect-private-key
- id: mixed-line-ending
- id: fix-encoding-pragma
args: ["--remove"]
- id: check-yaml
- id: check-added-large-files
name: Check for files larger than 5 MB
args: ["--maxkb=5120"]
- id: check-ast
exclude: |
(?x)^(
solutions/01_04.py|
solutions/02_21.py|
solutions/04_05.py|
solutions/05_01.py|
solutions/05_12.py
)$
- id: check-docstring-first
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: &autoflake
- --in-place
- --remove-all-unused-imports
- --expand-star-imports
- --remove-duplicate-keys
- --remove-unused-variables
exclude: |
(?x)^(
solutions/02_01.py
)$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- &flake8
id: flake8
additional_dependencies:
- flake8-docstrings==1.6.0
- flake8-eradicate==1.2.0
- flake8-fixme==1.1.1
- flake8-implicit-str-concat==0.2.0
- flake8-print==4.0.0
- flake8-return==1.1.3
args: ["--config=setup.cfg"]
- repo: local
hooks:
- id: linestripper-add
name: linestripper-add
entry: python linestripper.py add
language: system
always_run: true
pass_filenames: false
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
exclude: |
(?x)^(
solutions/01_04.py|
solutions/01_05.py|
solutions/02_21.py|
solutions/04_05.py|
solutions/05_01.py|
solutions/05_12.py
)$
- repo: local
hooks:
- id: linestripper-remove
name: linestripper-remove
entry: python linestripper.py remove
language: system
always_run: true
pass_filenames: false
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.3
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
hooks:
- id: isort
types: [python]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
- id: pyupgrade
args:
- "--py39-plus"
- repo: https://github.com/Cielquan/mirrors-poetry
rev: 1.1.13
hooks:
- id: poetry-check
- id: poetry-lock
args: ["--no-update"]
- id: poetry-export
args: ["--without-hashes"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
hooks:
- id: prettier
types_or: [yaml]
additional_dependencies:
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint solutions
language: system
always_run: true
pass_filenames: false
# stages: [manual]
- id: pip-audit
name: pip-audit
entry: pip-audit
language: system
always_run: true
pass_filenames: false