This repository was archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.pre-commit-config.yaml
101 lines (90 loc) · 2.53 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
97
98
99
100
101
default_install_hook_types:
- pre-commit
- commit-msg
- post-checkout
- post-merge
- post-rewrite
ci:
skip:
- generate-config-schemas
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: detect-private-key
# This constraint the new syntax with current python version
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
- repo: https://github.com/rhysd/actionlint
rev: v1.7.6
hooks:
- id: actionlint
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args: ['--fix', '--unsafe-fixes']
- id: ruff-format
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
hooks:
- id: commitizen
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
hooks:
- id: check-github-workflows
- id: check-jsonschema
stages:
- manual
files: '^(check-phat-nguoi)?(\.)?config(\.)?(sample)?\.json$'
args: ['--schemafile', 'schemas/config.json']
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.14
hooks:
- id: uv-sync
- id: uv-lock # update lock file
- id: uv-export # export lock file to requirements.txt
args:
[
'--no-dev',
'--frozen',
'--output-file=requirements/requirements.txt',
'--quiet',
]
- id: uv-export # export lock file to requirements.txt for dev deps
args:
[
'--frozen',
'--output-file=requirements/requirements-dev.txt',
'--quiet',
]
- id: uv-export # export lock file to requirements.txt for "build-website" group deps
args:
[
'--only-group',
'build-website',
'--frozen',
'--output-file=requirements/requirements-build-website.txt',
'--quiet',
]
# NOTE: Create schemas on CI already
# - repo: local
# hooks:
# - id: generate-config-schemas
# name: Generate Config Schemas
# language: system
# entry: uv run generate-config-schema
# files: '^src/check_phat_nguoi/config/'
# types: [file, python]
# stages:
# - pre-commit
# - manual
# require_serial: true