-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
73 lines (63 loc) · 2.42 KB
/
.pre-commit-config.yaml
File metadata and controls
73 lines (63 loc) · 2.42 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
# pre-commit (https://pre-commit.com/) config file
# install pre-commit hooks via `pre-commit install --hook-type pre-commit`
# install post-merge hooks via `pre-commit install --hook-type post-merge`
# install post-checkout hooks via `pre-commit install --hook-type post-checkout`
# install pre-push hooks via `pre-commit install --hook-type pre-push`
# or all of them with `pre-commit install -t pre-commit -t pre-push -t post-merge -t post-checkout`
# You can skip certain hooks with e.g. `SKIP=black git push`
# You can skip all hooks with e.g. `git commit --no-verify`
# Uninstall hooks with `pre-commit uninstall [--hook-type <stage>]`
# If something doesn't work you can also try `pre-commit clean`
# to delete cached files (like virtual environments used by the hooks
fail_fast: true
default_install_hook_types: [pre-commit, pre-push, commit-msg, post-checkout, post-merge, post-commit]
default_stages: [pre-commit, pre-push]
minimum_pre_commit_version: "4"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict # Check for files that contain merge conflict strings
- id: detect-private-key # Detects the presence of private keys
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
hooks:
- id: validate-pyproject
- repo: local
hooks:
- id: lock
name: uv lock
entry: uv lock
language: system
files: "(pyproject.toml|version.py)"
pass_filenames: false
stages: [pre-commit, pre-push]
- id: sync
name: uv sync
entry: uv sync --frozen
language: system
pass_filenames: false
always_run: true
stages: [post-commit, post-merge, post-checkout]
- id: lint
name: ruff check
entry: uv run -- ruff check --force-exclude
args: [--fix]
language: system
stages: [pre-commit, pre-push, manual]
types_or: [python, pyi, jupyter]
require_serial: true
- id: format
name: ruff format
entry: uv run -- ruff format --force-exclude
language: system
stages: [pre-commit, pre-push, manual]
types_or: [python, pyi, jupyter]
require_serial: true
- id: ty
name: ty
entry: uv run -- ty check
language: system
stages: [pre-commit, pre-push, manual]
types_or: [python, pyi]
require_serial: true