Files
scaffold/template/.pre-commit-config.yaml.jinja
T
baozaotumao 39fe248f9f feat: 重组为标准 skill 包结构 + 修复 verify.sh bash 3.2 兼容
- 新增 .claude/skills/new-project/SKILL.md(标准 skill 格式)
- install-skill.sh 安装时组装 SKILL.md + verify.sh,单一源无重复
- verify.sh 改用索引数组替代 declare -A,兼容 macOS bash 3.2
- log_pass/log_skip 显式 return 0,避免 set -e 下非 verbose 误退出
- README 改为 skill 优先;补全 copier.yml/scripts/template 入库
2026-06-01 21:19:45 -07:00

68 lines
1.6 KiB
Django/Jinja
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 提交前自动跑的质量门禁。安装:pre-commit install
# 手动全量:pre-commit run --all-files
repos:
# 通用
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: detect-private-key
# 提交信息规范(Conventional Commits
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
{%- if include_backend or include_agent %}
# Pythonruff 同时做 lint + format
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
{%- endif %}
{%- if include_backend %}
- repo: local
hooks:
- id: mypy-backend
name: mypy (backend)
entry: bash -c 'cd backend && uv run mypy src'
language: system
files: ^backend/.*\.py$
pass_filenames: false
{%- endif %}
{%- if include_agent %}
- repo: local
hooks:
- id: mypy-agent
name: mypy (agent)
entry: bash -c 'cd agent && uv run mypy src'
language: system
files: ^agent/.*\.py$
pass_filenames: false
{%- endif %}
{%- if include_frontend %}
# 前端:lint + 类型检查
- repo: local
hooks:
- id: frontend-lint
name: eslint + tsc (frontend)
entry: bash -c 'cd frontend && pnpm lint && pnpm typecheck'
language: system
files: ^frontend/.*\.(ts|tsx)$
pass_filenames: false
{%- endif %}