-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
126 lines (126 loc) · 4.46 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
fail_fast: false # such that all edits will run subsequently
default_language_version:
python: python3.8
default_stages: [pre-commit]
ci:
autoupdate_schedule: quarterly # low frequency to reduce maintenance noise
repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: "v3.29.1"
hooks:
- id: commitizen
stages: [commit-msg]
# Fixes:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.7.0"
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
# - repo: https://github.com/pycqa/docformatter
# rev: v1.7.5
# hooks:
# - id: docformatter
# args: ["--in-place", "--config=./pyproject.toml"]
# language: python
# additional_dependencies: [tomli]
- repo: local
hooks:
- id: docformatter
name: docformatter
description: Formats docstrings to follow PEP 257.
entry: python -Im docformatter
additional_dependencies:
- docformatter == 1.7.5
- tomli
args:
- --in-place
- --config=./pyproject.toml
language: python
types:
- python
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
files: (.*\.md)
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-toml
args: [--autofix]
exclude: poetry.lock
- repo: https://github.com/python-poetry/poetry
rev: "1.8.0"
hooks:
- id: poetry-lock
name: poetry-lock (lib-a)
files: ^tests/fixtures/simple_a/lib-a/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-a"]
- id: poetry-lock
name: poetry-lock(lib-auto-enabled)
files: ^tests/fixtures/simple_a/lib-auto-enabled/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-auto-enabled"]
- id: poetry-lock
name: poetry-lock (lib-b)
files: ^tests/fixtures/simple_a/lib-b/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-b"]
- id: poetry-lock
name: poetry-lock(lib-disabled)
files: ^tests/fixtures/simple_a/lib-disabled/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-disabled"]
- id: poetry-lock
name: poetry-lock(lib-enabled)
files: ^tests/fixtures/simple_a/lib-enabled/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-enabled"]
- id: poetry-lock
name: poetry-lock(lib-enabled-extras)
files: ^tests/fixtures/simple_a/lib-enabled-extras/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-enabled-extras"]
- id: poetry-lock
name: poetry-lock(lib-enabled-no-commands)
files: ^tests/fixtures/simple_a/lib-enabled-no-commands/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-enabled-no-commands"]
- id: poetry-lock
name: poetry-lock(lib-independent)
files: ^tests/fixtures/simple_a/lib-independent/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-independent"]
- id: poetry-lock
name: poetry-lock(lib-missing)
files: ^tests/fixtures/simple_a/lib-missing/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-missing"]
- id: poetry-lock
name: poetry-lock(lib-nested)
files: ^tests/fixtures/simple_a/lib-nested/pyproject.toml
args: ["--no-update", "-C", "tests/fixtures/simple_a/lib-nested"]
# Checks:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.0
hooks:
- id: mypy
args: ["--config-file", "pyproject.toml"]
additional_dependencies: ["poetry~=1.7.1", "poetry-core~=1.8.1"]
- repo: https://github.com/python-poetry/poetry
rev: "1.8.0"
hooks:
- id: poetry-check