-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
92 lines (82 loc) · 2.45 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
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/psf/black
rev: "24.10.0" # when changed, also update the version in blacken-docs
hooks:
- id: black
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black==24.10.0]
- repo: https://github.com/pycqa/isort
rev: "5.13.2"
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: "7.1.1"
hooks:
- id: flake8
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: ["tomli"] # needed to parse pyproject.toml
exclude: '^poetry\.lock|pyproject\.toml|.*\.svg$'
- repo: https://github.com/python-poetry/poetry/
rev: "1.8.0"
hooks:
- id: poetry-check
name: "poetry: check pyproject.toml syntax"
- id: poetry-check
name: "poetry: check poetry.lock consistency"
args: ["--lock"]
files: '^(pyproject\.toml|poetry\.lock)$'
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
additional_dependencies: [tomli]
exclude: "^(tests/)|(type_checks/)|(examples/)"
- repo: https://github.com/kynan/nbstripout
rev: 0.8.0
hooks:
- id: nbstripout
args:
[
"--extra-keys",
"metadata.interpreter metadata.kernelspec metadata.language_info metadata.vscode",
]
- repo: https://github.com/ansys/pre-commit-hooks
rev: v0.4.3
hooks:
- id: add-license-headers
args: ["--start_year", "2022"]
- repo: local
hooks:
- id: mypy-code
name: "mypy: strict checks on code"
entry: mypy
language: python
types: [python]
require_serial: true
exclude: "^(doc/)|(tests/)|^(examples/)"
args: ["--strict", "--namespace-packages", "--explicit-package-bases"]
- id: mypy-tests
name: "mypy: lenient checks on tests"
entry: mypy
language: python
types: [python]
require_serial: true
files: "^(tests/)|^(examples/)"
args: [
"--strict",
"--namespace-packages",
"--explicit-package-bases",
"--disable-error-code", "no-untyped-def",
"--disable-error-code", "no-untyped-call"
]