-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
99 lines (85 loc) · 2.24 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
99 lines (85 loc) · 2.24 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
# .pre-commit-config.yaml
#
# This file runs quality checks through uvx.
#
# Install after creating virtual environment:
# uvx pre-commit install
#
# Periodically update:
# uvx pre-commit autoupdate
#
# Run all checks (might have to run it twice):
# uvx pre-commit run --all-files
---
# Don't attempt to format these kinds of files
exclude: |
(?x)^(
\.DS_Store|
\.coverage|
\.ipynb_checkpoints/|
\.mypy_cache/|
\.nox/|
\.pytest_cache/|
\.ruff_cache/|
\.tox/|
\.venv/|
.*\.(egg-info)/|
build/|
coverage\.xml|
dist/|
htmlcov/|
node_modules/|
site/
)
repos:
# ------------------- ALL LOCAL FIRST ---------------------
- repo: local
hooks:
# ------------------- BASELINE CHECKS -------------------
- id: B1-validate-pyproject
name: B1) Validate pyproject
entry: uvx validate-pyproject
language: system
pass_filenames: false
files: pyproject.toml
- id: B2-ruff-format
name: B2) Ruff format (normalize EOF and whitespace)
entry: uvx ruff format
language: system
types: [python]
- id: B3-ruff-check
name: B3) Ruff check (lint, autofix)
entry: uvx ruff check --fix
language: system
types: [python]
- id: B4-deptry
name: B4) Deptry (dependency check)
entry: uvx deptry .
language: system
pass_filenames: false
- id: B5-pyright
name: B5) Pyright (type checking)
entry: uvx pyright
language: system
pass_filenames: false
types: [python]
- id: B6-bandit
name: B6) Bandit (security)
entry: uvx bandit -c pyproject.toml -r src
language: system
pass_filenames: false
types: [python]
# ------------------- COVERAGE -------------------
- id: C1-pytest
name: C1) Pytest
entry: uv run pytest
language: system
pass_filenames: false
types: [python]
# ------------------- THEN, EXTERNAL REPOS ---------------------
- repo: https://github.com/rhysd/actionlint
rev: v1.7.8
hooks:
- id: actionlint
name: B7) Actionlint (GitHub Actions Linter)
files: ^\.github/workflows/.*\.ya?ml$