-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
102 lines (93 loc) · 2.59 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
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
args:
- --max-line-length=88
- --select=C,E,F,W,B
- --extend-ignore=E203,E501,W503 # no select B950 for now and added W503 since it is incompatible with PEP8, rest is to be compatible with black, see https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
additional_dependencies:
- flake8-bugbear
- repo: https://github.com/PyCQA/isort
rev: 5.13.2 # need 5.12.0 to fix RuntimeError: The Poetry configuration is invalid
hooks:
- id: isort
args:
- --multi-line=3
- --profile=black # to be compatible with black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
exclude: ^config/
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
args:
- src
- tests
pass_filenames: false
additional_dependencies:
- pydantic
- pytest
- rich
- typer
- types-PyYAML
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
hooks:
- id: nbqa-black
# additional_dependencies: [jupytext] # optional, only if you're using Jupytext
- id: nbqa-pyupgrade
args: [--py310-plus]
- id: nbqa-isort
args: [--float-to-top, --profile=black]
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
- repo: local
hooks:
- id: pdm-export
name: pdm-export
entry: pdm export
args:
- -o
- requirements.txt
- --without-hashes
- --pyproject
language: system
pass_filenames: false
- id: pdm-lock-check
name: pdm-lock-check
entry: pdm lock --check
language: system
pass_filenames: false
- id: pytest-check
name: pytest-check
entry: pdm run pytest
args:
- tests
- -vv
language: system
pass_filenames: false
always_run: true