-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
141 lines (141 loc) · 4 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
exclude: |
(?x)^(
\.copier-answers\.yml
|changelog/towncrier_template\.md\.jinja
|lock.*\.json
$)
ci:
skip:
- "sync"
- "fawltydeps-src"
- "fawltydeps-docs"
- "fawltydeps-scripts"
- "fawltydeps-tests"
- "pyright"
- "pytest-fast-only"
- "synchronize-params"
autoupdate_schedule: "quarterly"
default_install_hook_types:
- pre-commit
- post-checkout # sync
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 ". scripts/Initialize-Shell.ps1; scripts/Sync-Py.ps1"
- id: "fawltydeps-src"
name: "fawltydeps-src"
pass_filenames: false
language: "system"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; fawltydeps --config-file pyproject.toml"
files: |
(?x)^(
pyproject.toml
|src/.*$
)$
- id: "fawltydeps-docs"
name: "fawltydeps-docs"
pass_filenames: false
language: "system"
files: "^docs/.*$"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; fawltydeps --config-file docs/pyproject.toml"
- id: "fawltydeps-scripts"
name: "fawltydeps-scripts"
pass_filenames: false
language: "system"
files: "^scripts/.*$"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; fawltydeps --config-file scripts/pyproject.toml"
- id: "fawltydeps-tests"
name: "fawltydeps-tests"
pass_filenames: false
language: "system"
files: "^tests/.*$"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; fawltydeps --config-file tests/pyproject.toml"
- id: "pyright"
name: "pyright"
pass_filenames: false
language: "system"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; pyright"
types_or: ["python", "pyi"]
- id: "pytest-fast-only"
name: "pytest-fast-only"
pass_filenames: false
language: "system"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; pytest -m 'not slow'"
files: |
(?x)^(
.*/pyproject\.toml
|docs/.*
|requirements/.*
|scripts/.*
|src/.*
|tests/.*
)$
- id: "synchronize-params"
name: "synchronize-params"
language: "system"
entry: "pwsh -Command python -m boilerdaq.models.params"
files: |
(?x)^(
src/boilerdaq/models/.*
|params.yaml
)$
- 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/.*
|notebooks/.*
|src/.*
|tests/.*
)$
- repo: "https://github.com/charliermarsh/ruff-pre-commit"
rev: "v0.4.10"
hooks:
- id: "ruff"
args: ["--extend-fixable", "PIE790"]
types_or: ["python", "pyi", "jupyter"]
- id: "ruff-format"
types_or: ["python", "pyi", "jupyter"]