-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
147 lines (139 loc) · 4.01 KB
/
.pre-commit-config.yaml
File metadata and controls
147 lines (139 loc) · 4.01 KB
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
142
143
144
145
146
147
ci:
autofix_prs: false
repos:
- repo: local
hooks:
# Prevent committing .rej files from copier
- id: forbidden-copier-rej-files
name: forbidden copier rej files
entry: found Copier update rejection files; review them and remove them
language: fail
files: \.rej$
- repo: local
hooks:
# Prevent committing test.py files within the tests directory
- id: forbidden-testpy-files
name: forbidden testpy files
entry: found test.py file inside tests directory; rename or remove them
language: fail
files: ((./tests/.*/test.py)|(./tests/test.py))$
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
hooks:
- id: validate-pyproject
- repo: local
hooks:
- id: uv-lock
name: uv-lock
entry: uv lock --offline
files: ^(uv\.lock|pyproject\.toml|uv\.toml)$
additional_dependencies:
- uv==0.7.13
language: python
always_run: true
pass_filenames: false
- id: uv-sync
name: uv-sync
entry: uv sync --no-active --offline
args: [--locked]
additional_dependencies:
- uv==0.7.13
language: python
always_run: true
pass_filenames: false
stages: [manual, pre-commit, pre-push, post-checkout, post-merge,
post-rewrite]
- id: uv-export
name: uv-export
files: ^uv\.lock|requirements.txt$
entry: uv export --frozen --offline --quiet --no-default-groups
-o="requirements.txt"
additional_dependencies:
- uv==0.7.13
language: python
pass_filenames: false
require_serial: true
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.6.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/python-formate/flake8-dunder-all
rev: v0.4.1
hooks:
- id: ensure-dunder-all
files: .*/__init__\.py$
exclude: tests/assets/
- repo: local
hooks:
- id: ruff-format
name: ruff-format
always_run: true
entry: uv run --frozen --offline ruff format --force-exclude
types_or: [python, pyi, jupyter]
additional_dependencies:
- uv==0.7.13
language: python
pass_filenames: false
- id: ruff-check
name: ruff-check
always_run: true
entry: uv run --frozen --offline ruff check --fix --force-exclude
--ignore "FIX"
types_or: [python, pyi, jupyter]
additional_dependencies:
- uv==0.7.13
language: python
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=100000]
- id: trailing-whitespace
exclude: (.*\.sh|.*\.d2|.*\.md|.*\.drawio|.*egg-info.*|)$
- id: check-merge-conflict
args: [--assume-in-merge]
- repo: local
hooks:
- id: nbstripout
name: nbstripout
entry: uv run --frozen --offline nbstripout
additional_dependencies:
- uv==0.7.13
language: python
files: .*\.(ipynb)$
exclude: .*\.(example|template|keepoutput|)\.ipynb$
- repo: local
hooks:
- id: deptry
name: deptry
entry: uv run --frozen --offline deptry src
additional_dependencies:
- uv==0.7.13
language: python
always_run: true
pass_filenames: false
- repo: local
hooks:
- id: import-linter
name: import-linter
always_run: true
entry: uv run --frozen --offline lint-imports
language: system
pass_filenames: false
require_serial: true
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
default_install_hook_types:
- pre-commit
- pre-push
- post-checkout
- post-merge
- post-rewrite
default_stages:
- pre-commit
- pre-push