Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
208 lines (208 loc) · 6.74 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
208 lines (208 loc) · 6.74 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-ast
exclude: ^tests/legacy/
- id: sort-simple-yaml
exclude: ^tests/legacy/
- id: check-yaml
exclude: |
(?x)^(
meta.yaml
| tests/legacy/
)$
- id: check-xml
exclude: ^tests/legacy/
- id: check-toml
exclude: ^tests/legacy/
- id: check-docstring-first
exclude: ^tests/legacy/
- id: check-json
exclude: ^tests/legacy/
- id: fix-encoding-pragma
exclude: ^tests/legacy/
- id: detect-private-key
exclude: ^tests/legacy/
- id: trailing-whitespace
exclude: ^tests/legacy/
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
# examples/01_atomic_capabilities/audio is ported verbatim from the sibling repo's
# samples/ tree, whose hooks exempt samples/.
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.0
hooks:
- id: mypy
# examples/01_atomic_capabilities/audio: mypy cannot map the
# digit-leading 01_atomic_capabilities segment to a module name
# (reports duplicate _common).
exclude:
(?x)(
pb2\.py$
| grpc\.py$
| ^docs
| ^tests/legacy/
| ^examples/01_atomic_capabilities/audio/
| \.html$
| \.pyi$
)
args: [
--ignore-missing-imports,
--disable-error-code=var-annotated,
--disable-error-code=union-attr,
--disable-error-code=assignment,
--disable-error-code=attr-defined,
--disable-error-code=import-untyped,
--disable-error-code=truthy-function,
--disable-error-code=arg-type,
--follow-imports=skip,
--explicit-package-bases,
]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [ --line-length=79 ]
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [ "--extend-ignore=E203"]
exclude: ^(tests/legacy|examples/01_atomic_capabilities/audio)/
- repo: https://github.com/pylint-dev/pylint
rev: v3.0.2
hooks:
- id: pylint
exclude:
(?x)(
^docs
| ^tests/
| ^examples/01_atomic_capabilities/audio/
| pb2\.py$
| grpc\.py$
| \.demo$
| \.md$
| \.html$
)
args: [
--disable=W0511,
--disable=W0718,
--disable=W0122,
--disable=C0103,
--disable=R0913,
--disable=E0401,
--disable=E1101,
--disable=C0415,
--disable=W0603,
--disable=R1705,
--disable=R0914,
--disable=E0601,
--disable=W0602,
--disable=W0604,
--disable=R0801,
--disable=R0902,
--disable=R0903,
--disable=C0123,
--disable=W0231,
--disable=W1113,
--disable=W0221,
--disable=R0401,
--disable=W0632,
--disable=W0123,
--disable=C3001,
--disable=W0201,
--disable=C0302,
--disable=W1203,
--disable=C2801,
--disable=C0114, # Disable missing module docstring for quick dev
--disable=C0115, # Disable missing class docstring for quick dev
--disable=C0116, # Disable missing function or method docstring for quick dev
]
# Tests get their own entry (pylint 3.0.2 discovers rcfiles from the
# invocation CWD, not per linted-file directory, so a tests/pylintrc
# would never be found): source-oriented checks that fight idiomatic
# pytest are disabled here only, keeping dashscope/ on the strict set.
# W0621 fixture shadowing, W0613 mock handlers ignoring the request,
# W0212 tests reaching into _private members by design.
- id: pylint
name: pylint (tests)
files: ^tests/
exclude: ^tests/legacy/
args: [
--disable=W0511,
--disable=W0718,
--disable=W0122,
--disable=C0103,
--disable=R0913,
--disable=E0401,
--disable=E1101,
--disable=C0415,
--disable=W0603,
--disable=R1705,
--disable=R0914,
--disable=E0601,
--disable=W0602,
--disable=W0604,
--disable=R0801,
--disable=R0902,
--disable=R0903,
--disable=C0123,
--disable=W0231,
--disable=W1113,
--disable=W0221,
--disable=R0401,
--disable=W0632,
--disable=W0123,
--disable=C3001,
--disable=W0201,
--disable=C0302,
--disable=W1203,
--disable=C2801,
--disable=C0114, # Disable missing module docstring for quick dev
--disable=C0115, # Disable missing class docstring for quick dev
--disable=C0116, # Disable missing function or method docstring for quick dev
--disable=W0621,
--disable=W0613,
--disable=W0212,
# ``assert x == []`` reads better than ``assert not x`` in pytest
# failure output, so C1803's simplification is unwanted here.
--disable=C1803,
# Long sequential arrange/act scripts are normal in integration
# tests; splitting them for R0915 hurts readability.
--disable=R0915,
# Table-driven tests are branchy by nature (R0912); test doubles
# deliberately hold resources open to assert lifecycle order
# (R1732); passthrough lambda seams read clearer than direct
# method refs (W0108); explicit trailing ``return`` marks the
# end of scripted callbacks (R1711).
--disable=R0912,
--disable=R1732,
--disable=W0108,
--disable=R1711,
]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.32.0
hooks:
- id: eslint
files: \.(js|jsx)$
exclude: '(.*js_third_party.*|^tests/legacy/)'
args: [ '--fix' ]
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v14.4.0
hooks:
- id: stylelint
files: \.(css)$
exclude: '(.*css_third_party.*|^tests/legacy/)'
args: [ '--fix' ]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.0.0'
hooks:
- id: prettier
additional_dependencies: [ 'prettier@3.0.0' ]
files: \.(tsx?)$
exclude: ^tests/legacy/