forked from Minidoracat/mcp-feedback-enhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
103 lines (95 loc) · 2.77 KB
/
.pre-commit-config.yaml
File metadata and controls
103 lines (95 loc) · 2.77 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Pre-commit hooks configuration for mcp-feedback-enhanced
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# 通用檔案檢查
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# 移除行尾空白
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
# 確保檔案以換行符結尾
- id: end-of-file-fixer
# 檢查合併衝突標記
- id: check-merge-conflict
# 檢查 YAML 語法
- id: check-yaml
args: [--unsafe] # 允許自定義 YAML 標籤
# 檢查 TOML 語法
- id: check-toml
# 檢查 JSON 語法
- id: check-json
# 檢查是否有大檔案(排除桌面應用二進制文件)
- id: check-added-large-files
args: [--maxkb=1000]
exclude: ^src/mcp_feedback_enhanced/desktop_release/.*\.(exe|mcp-feedback-enhanced-desktop-.*)$
# 檢查檔案名稱
- id: check-case-conflict
# 檢查可執行檔案有 shebang
- id: check-executables-have-shebangs
# 修復混合行結尾
- id: mixed-line-ending
args: [--fix=lf]
# Ruff - Python linting 和 formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.12
hooks:
# Ruff linter with auto-fix
- id: ruff
args: [--fix]
types_or: [python, pyi]
# Ruff formatter
- id: ruff-format
types_or: [python, pyi]
# mypy - 靜態類型檢查(暫時禁用,需要修復類型問題)
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.16.0
# hooks:
# - id: mypy
# additional_dependencies:
# - types-psutil
# - types-aiofiles
# args: [--config-file=pyproject.toml]
# files: ^src/
# exclude: ^tests/
# 檢查 Python 安全性問題(可選,較嚴格)
# - repo: https://github.com/PyCQA/bandit
# rev: 1.7.10
# hooks:
# - id: bandit
# args: ["-c", "pyproject.toml"]
# additional_dependencies: ["bandit[toml]"]
# 全域配置
default_language_version:
python: python3.11
# 排除的檔案和目錄
exclude: |
(?x)^(
\.git/|
\.venv/|
venv/|
build/|
dist/|
node_modules/|
\.trunk/|
\.mypy_cache/|
\.ruff_cache/|
\.pytest_cache/|
__pycache__/|
.*\.egg-info/|
tests/fixtures/.*|
scripts/.*\.js|
src/mcp_feedback_enhanced/web/static/.*
)$
# CI 配置
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false