-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
104 lines (94 loc) · 3.14 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
104 lines (94 loc) · 3.14 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
# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-config.json
---
ci:
autoupdate_schedule: quarterly
skip: ["identity", "uv-lock", "pytest", "test-coverage", "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
args: ["--branch", "main"]
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: "coverage.svg"
- id: mixed-line-ending
- id: check-added-large-files
- id: check-json
- id: check-yaml
- id: check-toml
- id: check-ast
- id: detect-private-key
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.6.1
hooks:
- id: check-pre-commit-ci-config
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.26
hooks:
- id: uv-lock
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.20
hooks:
- id: ruff-check
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/billwallis/bills-hooks
rev: v0.0.15
hooks:
- id: banned-python-code
- id: check-no-commit-comment
- id: tidy-gitkeep
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.4
hooks:
- id: check-github-workflows
- id: check-compose-spec
- repo: local
hooks:
- <<: &check-jsonschema-config
entry: check-jsonschema
pass_filenames: true
language: python
additional_dependencies: ["check-jsonschema==0.37.2"]
# This calls a remote URL, so run on pre-push to avoid slowing down commits
stages: ["pre-push"]
id: check-pyproject-schema
name: Validate pyproject.toml schema
files: pyproject.toml
args: ["--schemafile", "https://json.schemastore.org/pyproject.json"]
- <<: *check-jsonschema-config
id: check-pre-commit-hooks-schema
name: Validate .pre-commit-hooks.yaml schema
files: .pre-commit-hooks.yaml
args: ["--schemafile", "https://json.schemastore.org/pre-commit-hooks.json"]
- repo: local
hooks:
- <<: &tests-config
language: unsupported
pass_filenames: false
always_run: true
stages: ["pre-push"]
id: pytest
name: Run unit tests
entry: uv run coverage run -m pytest --quiet
- <<: *tests-config
id: coverage-xml
name: Write coverage XML report
entry: uv run coverage xml --quiet
- <<: *tests-config
id: test-coverage
name: Tests have 100% run coverage
entry: uv run coverage report --no-skip-covered --include 'tests/*' --fail-under 100
- <<: *tests-config
id: coverage-badge
name: Generate coverage badge
entry: genbadge coverage --input-file 'coverage.xml' --output-file coverage.svg --silent
# https://github.com/smarie/python-genbadge/releases
additional_dependencies: ["genbadge[coverage]==1.1.3"]
language: python