-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
59 lines (53 loc) · 1.95 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
59 lines (53 loc) · 1.95 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
# .pre-commit-config.yaml
minimum_pre_commit_version: "3.0.0"
repos:
# 1. 提交消息检查(commitlint)
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
hooks:
- id: commitizen
stages: [commit-msg]
additional_dependencies: ["cz-conventional-gitmoji"]
# 2. ESLint 检查(Vue3 + React Native)—— ESLint 9
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.6.0
hooks:
- id: eslint
name: ESLint (Frontend + Mobile)
files: ^(RagFrontend|RagMobile)/.*\.(js|ts|vue|tsx)$
types: [file]
args: [--fix, --config, RagFrontend/eslint.config.cjs]
# 3. Prettier 格式化
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.5.3
hooks:
- id: prettier
name: Prettier (Frontend + Mobile)
files: ^(RagFrontend|RagMobile)/.*\.(js|ts|vue|tsx|json|md|yaml|yml|css|scss)$
# 4. 后端 Python 检查(Ruff)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.8
hooks:
- id: ruff
files: ^RagBackend/
exclude: ^RagBackend/Rag_M/src/
args: [--fix, --config, RagBackend/pyproject.toml]
- id: ruff-format
files: ^RagBackend/
exclude: ^RagBackend/Rag_M/src/
args: [--config, RagBackend/pyproject.toml]
- id: ruff
files: ^RagBackend/Rag_M/src/
args: [--fix, --config, RagBackend/Rag_M/src/pyproject.toml]
- id: ruff-format
files: ^RagBackend/Rag_M/src/
args: [--config, RagBackend/Rag_M/src/pyproject.toml]
# 5. 通用检查
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=500"]