-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
54 lines (48 loc) · 1.8 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
54 lines (48 loc) · 1.8 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
# Vendored flow-v2 toolchain — never touched by hooks; refresh via
# templates/flow-v2-shared/sync-tools.sh.
exclude: ^templates/flow-v2-shared/tools/
default_install_hook_types: [pre-commit, commit-msg]
repos:
# Ruff for formatting and linting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.2
hooks:
# Run formatter first (auto-fixes)
- id: ruff-format
types_or: [python, pyi]
# Then run linter (auto-fixes when possible)
- id: ruff
types_or: [python, pyi]
args: [--fix, --exit-non-zero-on-fix]
# Pre-commit built-in hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
exclude: ^tasks/|^mkdocs\.yml$ # tasks/: YAML templates with variables; mkdocs.yml: Material's !ENV tag
- id: check-added-large-files
args: ['--maxkb=500']
exclude: ^docs/assets/hero\.gif$ # README hero media
- id: check-merge-conflict
- id: detect-private-key
- id: check-case-conflict
# Type checking (slower, optional via --hook-stage manual)
- repo: local
hooks:
- id: pyright
name: pyright type checker
entry: uv run pyright
language: system
types: [python]
pass_filenames: false
stages: [manual] # Run only with: pre-commit run --hook-stage manual pyright
# Mirrors .github/workflows/conventional-commits.yml's commit-message check.
# (The PR-title half of that workflow can't be checked locally — GitHub
# only knows the PR title once the PR exists.)
- id: conventional-commit-msg
name: conventional commit message
entry: scripts/check_commit_msg.sh
language: script
stages: [commit-msg]