-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.pre-commit-config.yaml
96 lines (96 loc) · 2.62 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
# INSTALL .: `pre-commit install`
# UPDATE ..: `pre-commit autoupdate`
exclude: |
(?x)^(
CHANGELOG\..*|
\.copier-answers\..*|
\.copier/answers\..*|
.*/vendor/.*|
.+\.min\.(css|js)|
.+\.svg
)$
default_language_version:
python: python3.12
default_install_hook_types:
- commit-msg
- pre-commit
repos:
# General
# https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Whitespace
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- "--fix=lf"
# VCS
- id: check-merge-conflict
args:
- "--assume-in-merge"
# Binaries
- id: check-shebang-scripts-are-executable
# Config / Data Files (syntax check only)
- id: check-json
- id: check-yaml
- id: check-toml
- id: check-xml
# Python
- id: debug-statements
# Sensible Data
- id: detect-private-key
# Markdown
# https://github.com/executablebooks/mdformat
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22
hooks:
- id: mdformat
additional_dependencies:
- mdformat-config
- mdformat-frontmatter
- mdformat-mkdocs
- mdformat-tables
# skip linting Hugo content b/c of this bug:
# https://github.com/executablebooks/mdformat/issues/402
exclude: ^site/content/.*
# Conventional Commits <https://www.conventionalcommits.org/>
# https://github.com/compilerla/conventional-pre-commit
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.0.0
hooks:
- id: conventional-pre-commit
stages:
- commit-msg
args:
- change
- chore
- feat
- fix
# Python: lint and format code
# https://github.com/astral-sh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
hooks:
- id: ruff
args:
- "--fix"
- "--exit-non-zero-on-fix"
- "--target-version=py312"
# https://docs.astral.sh/ruff/rules/
- "--select=F,E4,E7,E9,I,UP,B,N"
- "--config"
- "lint.isort.force-single-line=true"
- "--config"
- "format.docstring-code-format=true"
- id: ruff-format
args:
- "--target-version=py312"
# Python: check project (i.e. `pyproject.toml`)
# https://github.com/abravalheri/validate-pyproject
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
hooks:
- id: validate-pyproject