-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
57 lines (51 loc) · 1.36 KB
/
.pre-commit-config.yaml
File metadata and controls
57 lines (51 loc) · 1.36 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
fail_fast: false
default_stages: [pre-commit]
repos:
# Basic file hygiene
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--unsafe]
- id: check-toml
- id: check-added-large-files
- id: no-commit-to-branch
args: [--branch, main]
# pyproject.toml validation
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
hooks:
- id: validate-pyproject
# Ruff: lint first, then format
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.0
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
# ty (Astral type checker — replaces mypy)
- repo: local
hooks:
- id: ty
name: ty (type check)
language: system
entry: uvx ty check --ignore unresolved-import --ignore possibly-missing-attribute src/
pass_filenames: false
types: [python]
# Secret scanning
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.1
hooks:
- id: gitleaks
# Tests + coverage — on push only (slow)
- repo: local
hooks:
- id: pytest
name: pytest with coverage
stages: [pre-push]
language: system
entry: uv run pytest
pass_filenames: false
always_run: true