Skip to content

chore(devx #88): remove license header injection + git pre-commit hook#1701

Merged
earayu merged 1 commit into
mainfrom
chenyexuan/devx-remove-license-pre-check
Apr 25, 2026
Merged

chore(devx #88): remove license header injection + git pre-commit hook#1701
earayu merged 1 commit into
mainfrom
chenyexuan/devx-remove-license-pre-check

Conversation

@earayu
Copy link
Copy Markdown
Collaborator

@earayu earayu commented Apr 25, 2026

Summary

Per @earayu2 msg=d02d70dd: agents are blocked on every commit by the addlicense git pre-commit hook (it injects Apache headers and aborts the commit asking to re-commit). The project no longer needs forced license header injection at this stage; this PR removes the friction so agents can commit smoothly.

Task #88 (canonical DevX hygiene lane per architect msg=c4c6bd09 / msg=967b3737); #87 closed as duplicate.

What is removed

File Reason
`scripts/hooks/pre-commit` The actual blocker — runs `make add-license` which modifies files mid-commit and forces a redo.
`scripts/hooks/README.md` + `scripts/hooks/README-zh.md` Hook documentation (no longer relevant).
`scripts/install-hooks.sh` Helper that copied `scripts/hooks/*` into `.git/hooks/`.
`Makefile` targets: `add-license` / `check-license` / `install-addlicense` / `install-hooks` License binary + hook installer no longer needed; the `./downloads/addlicense` download path is also gone.
`Makefile` `env-dev` deps No longer depends on `install-addlicense` / `install-hooks`; new clones get a clean dev environment with no license tooling.
`docs/zh-CN/development/development-guide.md` lines 67–69 Removed bullets that described the now-gone hooks + addlicense steps.

What is kept (per scope discipline)

  • `make lint` / `make format` (ruff check + format) — still the canonical hygiene gate, runs in CI `lint-and-unit`.
  • Existing license headers in source files — not stripped, since bulk-removing them would be a huge unrelated diff (`grep` shows ~hundreds of files). Future authors are simply no longer forced to add new headers; existing ones decay naturally.
  • Unit / e2e test gates — untouched.
  • CI workflows — never referenced `add-license` / `check-license` / pre-commit hooks (verified via `grep -rln "addlicense\|add-license\|check-license\|install-hooks\|pre-commit" .github/` returns no matches), so no CI changes needed.

Verification

  • `make -n env-dev` produces clean output with only `uv sync` + dev banner; no addlicense download, no hook install.
  • `grep -rn "license\|addlicense\|install-hooks\|pre-commit" Makefile docs/zh-CN/development/development-guide.md` returns no matches post-change.
  • Diff: 6 files changed, 2 insertions(+), 298 deletions(-).
  • Local agents that previously had the pre-commit hook installed will still have a stale copy in `.git/hooks/pre-commit` until they delete it manually; that is per-clone state, no repo action required. `make env-dev` for fresh clones produces no hook.

Boundary

Hygiene-only PR. No app code, no migration, no schema change. lint + unit gates from main remain in place; only the agent-friction tooling is removed.

Test plan

  • `make -n env-dev` dry-run — clean
  • `grep` audit confirms no remaining references in Makefile / docs
  • CI `lint-and-unit` — should pass (only deletes / no source code touched)

🤖 Generated with Claude Code

Per @earayu2 msg=d02d70dd: agents are blocked on every commit by the
``addlicense`` git pre-commit hook (it injects Apache headers and
aborts the commit asking the agent to re-commit). The project no
longer needs forced license header injection at this stage; this
PR removes the friction so agents can commit smoothly.

What is removed:

- ``scripts/hooks/`` (3 files: ``pre-commit`` + READMEs) -- the
  pre-commit hook that ran ``make lint`` + ``make add-license`` on
  every commit. ``make add-license`` modifies files mid-commit and
  forces a redo, which is the actual blocker.
- ``scripts/install-hooks.sh`` -- the helper that copied
  ``scripts/hooks/*`` into ``.git/hooks/``.
- ``Makefile`` targets: ``add-license`` / ``check-license`` /
  ``install-addlicense`` / ``install-hooks``. The ``addlicense``
  binary download path is also gone.
- ``env-dev`` no longer depends on ``install-addlicense`` /
  ``install-hooks``; new clones get a clean dev environment with no
  license tooling.
- ``docs/zh-CN/development/development-guide.md`` lines describing
  the now-removed hooks + addlicense steps.

What is kept (per scope discipline):

- ``make lint`` / ``make format`` (ruff check + format) -- still the
  canonical hygiene gate, runs in CI ``lint-and-unit``.
- Existing license headers in source files -- not stripped, since
  bulk-removing them would be a huge unrelated diff.
- Unit / e2e test gates -- untouched.
- CI workflows -- never referenced ``add-license`` / ``check-license``
  / pre-commit hooks (verified via grep), so no CI changes needed.

Local agents that previously had the pre-commit hook installed will
still have a stale copy in ``.git/hooks/pre-commit`` until they
delete it manually; that is per-clone state, no repo action required.
``make env-dev`` for fresh clones produces no hook.

Boundary: hygiene-only PR. No app code, no migration, no schema
change. lint + unit gates from main remain in place; only the
agent-friction tooling is removed.
@earayu earayu merged commit 8ed1d7b into main Apr 25, 2026
4 checks passed
@earayu earayu deleted the chenyexuan/devx-remove-license-pre-check branch April 25, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant