-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-config.yaml
72 lines (66 loc) · 1.92 KB
/
.pre-commit-config.yaml
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
---
ci:
autoupdate_schedule: quarterly
skip: ["identity", "poetry-lock", "pytest", "coverage-badge"]
repos:
- repo: meta
hooks:
- id: identity
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.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
- 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
- repo: https://github.com/python-poetry/poetry
rev: 2.0.0
hooks:
- id: poetry-check
name: Check that the Poetry configuration is valid
- id: poetry-lock
name: Check that the lock file is up-to-date
# Formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
name: Make code pretty
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
name: Lint Python code
args: ["--fix"]
- id: ruff-format
name: Format Python code
# Testing and coverage
- repo: local
hooks:
- id: pytest
name: Run unit tests
entry: pytest tests --quiet
language: system
pass_filenames: false
always_run: true
- id: coverage-badge
name: Generate coverage badge
entry: coverage-badge -o coverage.svg -f
language: system
pass_filenames: false
always_run: true