-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
118 lines (107 loc) · 3.4 KB
/
.pre-commit-config.yaml
File metadata and controls
118 lines (107 loc) · 3.4 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-config.json
---
ci:
autoupdate_schedule: quarterly
skip: ["identity", "uv-lock", "pytest", "coverage-badge"]
default_install_hook_types: ["pre-commit", "pre-push"]
default_stages: ["pre-commit"]
repos:
- repo: meta
hooks:
- id: identity
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: no-commit-to-branch
name: Don't allow commits to the main branch
args: ["--branch", "main"]
- id: trailing-whitespace
name: Remove trailing whitespace
- id: end-of-file-fixer
name: Ensure files end with a newline character
exclude: "coverage.svg"
- id: mixed-line-ending
name: Align mixed line ending
- id: check-added-large-files
name: Check for large files
- id: check-json
name: Check JSON files are valid and parseable
- id: check-yaml
name: Check YAML files are valid and parseable
- id: check-toml
name: Check TOML files are valid and parseable
- id: check-ast
name: Validate Python
- id: detect-private-key
name: Check for the existence of private keys
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.6.1
hooks:
- id: check-pre-commit-ci-config
name: Validate pre-commit CI config
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.10.7
hooks:
- id: uv-lock
name: Check that the lock file is up-to-date
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
hooks:
- id: ruff-check
name: Lint Python code
args: ["--fix"]
- id: ruff-format
name: Format Python code
# # https://github.com/astral-sh/ty?tab=readme-ov-file#getting-started
# - repo: local
# hooks:
# - id: ty
# name: Run type checks
# entry: uvx ty check
# language: system
# pass_filenames: true
# always_run: false
# types: ["python"]
- repo: https://github.com/billwallis/bills-hooks
rev: v0.0.8
hooks:
- id: tidy-gitkeep
name: Remove redundant .gitkeep files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.0
hooks:
- id: check-github-workflows
- id: check-compose-spec
- repo: local
hooks:
- id: check-pyproject-schema
name: Validate pyproject.toml schema
entry: check-jsonschema
pass_filenames: true
language: python
additional_dependencies: ["check-jsonschema==0.37.0"]
files: pyproject.toml
args: ["--schemafile", "https://json.schemastore.org/pyproject.json"]
# This calls a remote URL, so run on pre-push to avoid slowing down commits
stages: ["pre-push"]
- repo: local
hooks:
- id: pytest
name: Run unit tests
entry: uv run pytest tests --quiet --cov-report=xml
stages: ["pre-push"]
language: unsupported
pass_filenames: false
always_run: true
- id: coverage-badge
name: Generate coverage badge
entry: >
genbadge coverage
--input-file 'coverage.xml'
--output-file coverage.svg
--silent
additional_dependencies: ["genbadge[coverage]==1.1.3"]
stages: ["pre-push"]
language: python
pass_filenames: false
always_run: true