Repository navigation
feat(hooks): 커밋 게이트가 package.json lint 스크립트를 돌린다 - #119
Closed
hsleedevelop wants to merge 4 commits into
Closed
hsleedevelop wants to merge 4 commits into
hsleedevelop wants to merge 4 commits into
Conversation
typecheck → lint → test 순서. lint 위반은 exit 2로 차단하고, 실행 불가(exit 127 — 린터 미설치)는 경고 후 통과한다. test 게이트는 127도 계속 차단한다(의도된 비대칭). 직전 판을 stock sha 테이블·fixture에 추가해 migrate refresh로 배달한다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
닫습니다. 2026-10-05 범위 재검토에서 커밋 게이트(typecheck·lint·test)와 auto-format을 하네스 범위에서 빼기로 결정했습니다. 품질 게이트는 프로젝트 도구(husky·lefthook·CI)의 몫으로 둡니다. 근거는 1.0 범위 헌장(D11 후보)에 기록합니다. 브랜치는 지우지 않았습니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
커밋 게이트
templates/.claude/hooks/pre-commit-check.sh가 package.json에lint스크립트가 있을 때 커밋 직전에 결정론적으로 실행한다. 지금까지 lint는 사람이/verify를 부를 때만 돌았다. 특정 린터나 규칙은 내장하지 않고 프로젝트가 이미 설정한 스크립트를 그대로 쓴다(스택 중립).$PM run lint결과에 따라0→ 통과127(command not found, 린터 미설치) → ⚠ 경고 두 줄 후 통과exit 2로 차단has_test_script를has_script <name>으로 일반화해 test와 lint가 함께 쓴다. jq가 없으면 node로 판정한다(기존 폴백 그대로).의도된 비대칭: lint 127은 경고, test 127은 차단
test 게이트는 바꾸지 않았다. test는 127이어도 계속 차단한다. lint만 127을 경고로 낮춘 이유는 착수 전 소비자 실측 때문이다. deep-math의
lint스크립트가 eslint 미설치로 exit 127이었다. 차단으로 도입하면 stock 훅을 쓰는 소비자의 모든 커밋이 갑자기 막힌다. 이 결정(C안)은 spec, overview 카드,hooks.mmd에 명시했다.PM별 127 전파 실측
빈 프로젝트에
"lint": "nonexistent-linter-xyz ."를 두고<pm> run lint를 실행했다.yarn install후)예외: yarn berry에서 install하지 않은 프로젝트는 스크립트를 실행하기 전에 lockfile 오류로 exit 1이 나온다. 위반과 구분할 수 없으므로 차단된다. PM 바이너리 자체가 없으면 127이 나와 lint는 경고하고, test 게이트가 같은 이유로 차단한다.
소비자 영향
npm run lint→ exit 127 (eslint: command not found, 의존성과 설정 모두 없음). 훅이 stock이라 migrate로 새 게이트가 배달된다. 그 뒤 매 커밋 ⚠ 경고가 나오지만 차단되지는 않는다.bun run lint→ exit 0. 다만 훅이 커스터마이즈본(bun.lock 감지 추가)이라 migrate가 덮지 않으므로 lint 게이트가 배달되지 않는다(기존 보존 계약).ed90db5b)을KNOWN_STOCK_HOOK_SHA256과tests/fixtures/stock-hooks/pre-lint/에 추가했다. stock 설치본은 refresh로 갱신되고, 커스터마이즈본은 보존된다.검증
tests/hooks-jq-fallback.test.mjs: npm 스텁으로 lint 위반 / 통과 / 스크립트 없음 / 127 경고 후 통과(test 127은 차단)를 jq 있음과 없음 양쪽에서 확인한다.tests/migrate-hooks.test.mjs: pre-lint 판 stock 설치본이 refresh로 lint 게이트를 받는지 확인한다.docs/hslee/commit-gate-lint/commit-gate-lint-artifact.md## Reviews에 있다.후속 후보 (이 PR 범위 밖)
detect_pm이bun.lockb만 봐서 bun 1.2+ 텍스트 락파일bun.lock프로젝트를 npm으로 오인한다.lint스크립트 정리(eslint 설치 또는 스크립트 제거).🤖 Generated with Claude Code