-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
91 lines (85 loc) · 2.21 KB
/
.pre-commit-config.yaml
File metadata and controls
91 lines (85 loc) · 2.21 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
default_install_hook_types:
- pre-commit
- post-checkout
- post-merge
- post-rewrite
repos:
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.26
hooks:
- id: uv-lock
stages:
- post-checkout
- post-merge
- post-rewrite
- id: uv-sync
args: ["--locked", "--all-extras"]
stages:
- post-checkout
- post-merge
- post-rewrite
# General hooks (apply globally)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# Filesystem
- id: check-illegal-windows-names
- id: check-case-conflict
# Git related
- id: check-added-large-files
- id: check-merge-conflict
# Security
- id: detect-private-key
# File validation
- id: check-json
exclude: ^(postgres/|\.vscode/|\.obsidian/)
- id: check-toml
exclude: ^postgres/
- id: check-xml
exclude: ^postgres/
- id: check-yaml
exclude: ^postgres/
# Python sanity checks
- id: check-ast
files: ^src/.*\.py$
- id: check-docstring-first
files: ^src/.*\.py$
- id: debug-statements
files: ^src/.*\.py$
# Validate packaging metadata early
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
stages: [pre-push, pre-commit]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
hooks:
- id: ruff
name: ruff lint
args: ["--fix", "--unsafe-fixes"]
files: ^src/.*\.py$
stages: [pre-push, pre-commit]
- repo: local
hooks:
- id: ty-check
name: ty check
language: system
entry: uvx ty check
pass_filenames: false
files: ^src/.*\.py$
stages: [pre-push, pre-commit]
- id: pytest
name: pytest
entry: ./.venv/bin/pytest .
stages: [pre-push]
language: system
types: [python]
pass_filenames: false
always_run: true
# Spell checking (global)
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
stages: [pre-push, pre-commit]