feat: Claude 署名开关 + commit-msg 门禁(生成项目自带)
- template/scripts/claude-attribution.sh:一条命令切换本项目是否含 Claude 署名 (on|off|status,存于 git config scaffold.includeClaude,默认 off) - template/scripts/check-claude-attribution.sh:commit-msg 门禁逻辑,off 时自动 - .pre-commit-config 增加 commit-msg 阶段 local 钩子调用门禁 - copier.yml _tasks 默认 git config scaffold.includeClaude false - 修复:template/scripts/*.sh 补可执行位(否则生成项目直接运行报 permission denied) - README 加「Claude 署名策略」章节 + 文件树补 template/scripts/ 验证:开关 on/off/status、门禁直接调用、经 pre-commit(language:system) 调用均生效, off 剥除 / on 保留,copier 生成 rc=0、脚本可执行、门禁已挂载。 scaffold 仓库自身亦已装本地 commit-msg 钩子,保证本仓库今后不含 Claude 署名。
This commit is contained in:
@@ -24,6 +24,15 @@ repos:
|
||||
- id: conventional-pre-commit
|
||||
stages: [commit-msg]
|
||||
|
||||
# Claude 署名门禁:按 scaffold.includeClaude 策略移除/保留(默认移除)
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: claude-attribution-gate
|
||||
name: Claude 署名门禁
|
||||
entry: bash scripts/check-claude-attribution.sh
|
||||
language: system
|
||||
stages: [commit-msg]
|
||||
|
||||
{%- if include_backend or include_agent %}
|
||||
|
||||
# Python(ruff 同时做 lint + format)
|
||||
|
||||
Reference in New Issue
Block a user