-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
122 lines (121 loc) · 3.19 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
exclude: |
(?x)^(
\.copier-answers\.yml
|changelog/towncrier_template\.md\.jinja
)$
ci:
skip:
- "sync"
- "fawltydeps-src"
- "fawltydeps-dev"
- "pytest-fast-only"
- "dvc-post-checkout"
- "dvc-pre-push"
autoupdate_schedule: "quarterly"
default_install_hook_types:
- "pre-commit"
- "post-checkout" # sync, dvc-post-checkout
- "pre-push" # dvc-pre-push
repos:
- repo: "meta"
hooks:
# ? Enable this to ensure each hook runs against at least one file
# - id: "check-hooks-apply"
- id: "check-useless-excludes"
- repo: "local"
hooks:
- id: "sync"
name: "sync"
stages:
- "pre-commit"
- "post-checkout"
pass_filenames: false
language: "system"
entry: |
pwsh -Command "./Invoke-Uv.ps1 -Sync -Update"
- id: "fawltydeps-src"
name: "fawltydeps-src"
pass_filenames: false
language: "system"
entry: |
pwsh -Command "./Invoke-Uv.ps1 fawltydeps --config-file pyproject.toml"
files: |
(?x)^(
pyproject\.toml
|src/.*
)$
- id: "fawltydeps-dev"
name: "fawltydeps-dev"
pass_filenames: false
language: "system"
entry: |
pwsh -Command "./Invoke-Uv.ps1 fawltydeps --config-file packages/_dev/pyproject.toml"
files: |
(?x)^(
packages/_dev/.*
|docs/.*
|tests/.*
)$
- id: "pytest-fast-only"
name: "pytest-fast-only"
pass_filenames: false
language: "system"
entry: |
pwsh -Command "./Invoke-Uv.ps1 pytest -m 'not slow'"
files: |
(?x)^(
.*/pyproject\.toml
|docs/.*
|requirements/.*
|scripts/.*
|src/.*
|tests/.*
)$
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v4.6.0"
hooks:
- id: "end-of-file-fixer"
- id: "trailing-whitespace"
- repo: "https://github.com/iterative/dvc"
rev: "3.51.2"
hooks:
- id: "dvc-post-checkout"
additional_dependencies: ["dvc[gs]"]
- id: "dvc-pre-push"
additional_dependencies: ["dvc[gs]"]
- repo: "https://github.com/DavidAnson/markdownlint-cli2"
rev: "v0.13.0"
hooks:
- id: "markdownlint-cli2"
- repo: "https://github.com/srstevenson/nb-clean"
rev: "3.3.0"
hooks:
- id: "nb-clean"
args:
- "--remove-empty-cells"
- "--preserve-notebook-metadata"
- "--preserve-cell-metadata"
- "tags"
- "--"
files: |
(?x)^(
docs/.*
|src/.*
|tests/.*
)$
- repo: "https://github.com/rbubley/mirrors-prettier"
rev: "v3.3.3"
hooks:
- id: "prettier"
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: "v0.9.3"
hooks:
- id: "taplo-format"
- repo: "https://github.com/charliermarsh/ruff-pre-commit"
rev: "v0.5.1"
hooks:
- id: "ruff"
args: ["--extend-fixable", "PIE790"]
types_or: ["python", "pyi", "jupyter"]
- id: "ruff-format"
types_or: ["python", "pyi", "jupyter"]