-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
159 lines (159 loc) · 4.5 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
159
# Update all versions in this file by running:
# $ pre-commit autoupdate
minimum_pre_commit_version: 2.20.0
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
name: Check for a blank line at the end of scripts (auto-fixes)
- id: trailing-whitespace
- id: check-builtin-literals
- 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
- 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
- id: check-docstring-first
- repo: https://github.com/myint/autoflake
rev: v1.5.3
hooks:
- id: autoflake
args: &autoflake
- --in-place
- --remove-all-unused-imports
- --expand-star-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- &flake8
id: flake8
additional_dependencies:
- flake8-docstrings==1.7.0
- flake8-eradicate==1.4.0
- flake8-fixme==1.1.1
- flake8-implicit-str-concat==0.4.0
- flake8-no-pep420==2.3.0
- flake8-print==5.0.0
- flake8-return==1.2.0
args: ["--config=.flake8"]
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
- 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.12.0
hooks:
- id: isort
types: [python]
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
hooks:
- id: pyupgrade
args:
- "--py310-plus"
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
name: detect-secrets - Detect secrets in staged code
args: [
"--baseline",
".secrets.baseline",
# https://regex101.com/
"--exclude-files '\\.secrets\\.baseline'",
"--exclude-files '\\.env\\.template'",
"--exclude-files '.*\\.ipynb$'",
# "--exclude-files '.*build/'",
"--exclude-secrets 'password|ENTER_PASSWORD_HERE|INSERT_API_KEY_HERE'",
"--exclude-lines 'integrity=*sha'",
]
# https://pre-commit.com/#regular-expressions
exclude: |
(?x)^(
\.secrets\.baseline|
\.env\.template
)$
- repo: https://github.com/jazzband/pip-tools
rev: 7.3.0
hooks:
- id: pip-compile
name: "pip-compile requirements"
args:
[
"--no-emit-index-url",
"--no-emit-trusted-host",
"--output-file",
"requirements.txt",
"pyproject.toml",
]
- id: pip-compile
name: "pip-compile cli requirements"
args:
[
"--no-emit-index-url",
"--no-emit-trusted-host",
"--extra",
"cli",
"--output-file",
"requirements-cli.txt",
"pyproject.toml",
]
- id: pip-compile
name: "pip-compile development requirements"
args:
[
"--no-emit-index-url",
"--no-emit-trusted-host",
"--extra",
"dev",
"--output-file",
"requirements-dev.txt",
"pyproject.toml",
]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.0
hooks:
- id: prettier
types_or: [yaml]
additional_dependencies:
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint musegai tests
# entry: bash -c 'pylint ./path/package1/; pylint ./path/package2/'
language: system
types: [python]
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
stages: [manual]