-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
117 lines (117 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
108
109
110
111
112
113
114
115
116
117
exclude: |
(?x)^(
\.copier-answers\.yml
$)
ci:
skip:
- "sync"
- "fawltydeps-src"
- "fawltydeps-docs"
- "fawltydeps-scripts"
- "fawltydeps-tests"
- "pytest-fast-only"
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"
exclude: |
(?x)^(
lock.+\.json
$)
- 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: "pytest-fast-only"
name: "pytest-fast-only"
pass_filenames: false
language: "system"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; pytest -m 'not slow' --suppress-no-test-exit-code"
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/DavidAnson/markdownlint-cli2"
rev: "v0.13.0"
hooks:
- id: "markdownlint-cli2"
- repo: "https://github.com/srstevenson/nb-clean"
rev: "3.2.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/charliermarsh/ruff-pre-commit"
rev: "v0.4.1"
hooks:
- id: "ruff"
args: ["--extend-fixable", "PIE790"]
types_or: ["python", "pyi", "jupyter"]
- id: "ruff-format"
types_or: ["python", "pyi", "jupyter"]