-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
80 lines (74 loc) · 1.81 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
80 lines (74 loc) · 1.81 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
repos:
# Ruff - Python linter 和 formatter (替代了很多 pre-commit-hooks)
- repo: local
hooks:
- id: ruff-check
name: ruff check (linting)
entry: ruff check --fix
language: system
types: [python]
require_serial: true
- id: ruff-format
name: ruff format
entry: ruff format
language: system
types: [python]
require_serial: true
# Pyright - 类型检查
- repo: local
hooks:
- id: pyright
name: pyright type check
entry: pyright
language: system
types: [python]
pass_filenames: false
# YAML linting
- repo: local
hooks:
- id: yamllint
name: yamllint
entry: yamllint
language: system
types:
- yaml
args:
- -c=.yamllint
# yamlfix - YAML formatter
- repo: local
hooks:
- id: yamlfix
name: yamlfix
entry: yamlfix
language: system
types:
- yaml
args:
- --config-file
- pyproject.toml
# Prettier for Markdown
- repo: local
hooks:
- id: prettier
name: prettier markdown
entry: pnpm run format:md
language: system
files: \.md$
pass_filenames: false
# Mermaid validation
- repo: local
hooks:
- id: validate-mermaid
name: validate mermaid diagrams
entry: bash -c 'find docs -name "*.md" -exec npx mermaid-validate validate-md {} \;'
language: system
files: \.md$
pass_filenames: false
# 只保留 ruff 不能处理的必要检查
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-json
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict