-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.pre-commit-config.yaml
107 lines (91 loc) · 3.28 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # frozen: v4.6.0
hooks:
# check file system problems
- id: check-case-conflict
- id: check-symlinks
- id: destroyed-symlinks
# unify whitespace and line ending
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: mixed-line-ending
# sort requirements.txt files
- id: requirements-txt-fixer
# check more
- id: check-yaml
- id: check-toml
- id: check-xml
- id: check-executables-have-shebangs
- id: check-merge-conflict
- repo: https://github.com/python-poetry/poetry
rev: "c85477da8a610a87133299f996f8d8a593aa7bff" # frozen: 1.8.0
hooks:
- id: poetry-check
- id: poetry-lock
args: ["--no-update"]
files: ^pyproject\.toml|poetry\.lock$
- repo: https://github.com/floatingpurr/sync_with_poetry
rev: 41b6bf233c52f08f344e09107bdda253e6d8b57a # frozen: 1.1.0
hooks:
- id: sync_with_poetry
files: ^\.pre-commit-config\.yaml|poetry\.lock$
pass_filenames: false
args:
- "poetry.lock"
- "--allow-frozen"
- "--db"
- "swp.json"
# Enforce frozen revisions in `.pre-commit-config.yaml`
- repo: https://github.com/real-yfprojects/check-pre-commit-config
rev: ec697f7fda57bd81b86556212539e22f03aa86d9 # frozen: v1.0.0-alpha4
hooks:
- id: check-frozen
args:
- "--rules"
- "ycamfte"
- "--fix-all"
# Lint python code with ruff (also sorts imports)
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "f0b5944bef86f50d875305821a0ab0d8c601e465" # frozen: v0.8.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Format python code with black
- repo: https://github.com/psf/black
rev: ec91a2be3c44d88e1a3960a4937ad6ed3b63464e # frozen: 23.12.1
hooks:
- id: black
# Static type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: bbc3dc1f890007061f18f17e2334f216ea9e5df7 # frozen: v1.14.1
hooks:
- id: mypy
exclude: ^(tests|docs)
args: [--ignore-missing-imports]
# format many other files with prettier
- repo: "https://github.com/pycontribs/mirrors-prettier"
rev: b28ab1718b516827e9f6cdfbd3c4c9546489d53e # frozen: v3.3.2
hooks:
- id: prettier
exclude: ^docs/(sphinx/_)templates/
- repo: https://github.com/abravalheri/validate-pyproject
rev: bea368871c59605bf2471441d0c6214bd3b80c44 # frozen: v0.18
hooks:
- id: validate-pyproject
files: pyproject.toml$
# configuration for the pre-commit.ci bot
# only relevant when actually using the bot
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci, https://pre-commit.com and
the `.pre-commit-config.yaml` file in this repository.
autofix_prs: true # default
autoupdate_branch: "develop"
autoupdate_commit_msg: |
[pre-commit.ci] Autoupdate pre-commit hook versions.
for more information, see https://pre-commit.ci, https://pre-commit.com and
the `.pre-commit-config.yaml` file in this repository.
submodules: false # default