-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
75 lines (74 loc) · 2.84 KB
/
.pre-commit-config.yaml
File metadata and controls
75 lines (74 loc) · 2.84 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
ci:
skip: [pylint]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.281"
hooks:
- id: ruff
args: ["--fix"]
exclude: &fixtures tests(/\w*)*/functional/|tests/input|doc/data/messages|tests(/\w*)*data/|scripts|examples
- id: ruff
name: ruff-doc
files: doc/data/messages
args: ["--config", ".ruff.toml"]
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
args: [--safe, --quiet, --line-length, "120"]
exclude: *fixtures
- id: black
name: black-doc
args: [--safe, --quiet, --line-length, "120"]
files: doc/data/messages/
exclude: |
(?x)^(
doc/data/messages/b/bad-indentation/bad.py|
doc/data/messages/i/inconsistent-quotes/bad.py|
doc/data/messages/i/invalid-format-index/bad.py|
doc/data/messages/l/line-too-long/bad.py|
doc/data/messages/m/missing-final-newline/bad.py|
doc/data/messages/m/multiple-statements/bad.py|
doc/data/messages/r/redundant-u-string-prefix/bad.py|
doc/data/messages/s/superfluous-parens/bad.py|
doc/data/messages/s/syntax-error/bad.py|
doc/data/messages/t/too-many-ancestors/bad.py|
doc/data/messages/t/trailing-comma-tuple/bad.py|
doc/data/messages/t/trailing-newlines/bad.py|
doc/data/messages/t/trailing-whitespace/bad.py|
doc/data/messages/u/unnecessary-semicolon/bad.py
)$
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: ["-rn", "-sn", "--rcfile=.pylintrc", "--fail-on=I"]
exclude: test(/\w*)|src/ditto/patches|scripts|examples
# We define an additional manual step to allow running pylint with a spelling
# checker in CI.
- id: pylint
alias: pylint-with-spelling
name: pylint
entry: pylint
language: system
types: [python]
args: ["-rn", "-sn", "--rcfile=.pylintrc", "--fail-on=I", "--spelling-dict=en"]
exclude: test(/\w*)|src/ditto/patches|scripts|examples
stages: [manual]
- id: check-newsfragments
name: Check newsfragments
entry: python3 -m script.check_newsfragments
language: system
types: [text]
files: ^(doc/whatsnew/fragments)
exclude: doc/whatsnew/fragments/_.*.rst
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
args: [--config-file=.mypy.ini]
exclude: test(/\w*)|src/ditto/patches|scripts|examples