diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28a5ca8a7a3..b6a75aafd49 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,7 +110,7 @@ For coordinated change sets that genuinely need more than 20 PRs, join the **#cl - Keep PRs takeover-ready: open them from a branch maintainers can push to. For fork PRs, leave GitHub's **Allow edits by maintainers** option enabled so maintainers can finish urgent fixes, changelog entries, or merge prep when needed. If GitHub shows **Allow edits and access to secrets by maintainers**, enable it only when that workflow/secrets access is acceptable and say so in the PR. - Do not edit `CHANGELOG.md` in contributor PRs. Maintainers or ClawSweeper add the changelog entry when landing user-facing changes. - Run tests: `pnpm build && pnpm check && pnpm test` -- For iterative local commits, `scripts/committer --fast "message" ` passes `FAST_COMMIT=1` through to the pre-commit hook so it skips the repo-wide `pnpm check`. Only use it when you've already run equivalent targeted validation for the touched surface. +- For iterative local commits, `scripts/committer --fast "message" ` skips commit hooks. Only use it when you've already run equivalent targeted validation for the touched surface. - For extension/plugin changes, run the fast local lane first: - `pnpm test:extension ` - `pnpm test:extension --list` to see valid extension ids diff --git a/scripts/committer b/scripts/committer index 4c76ac98f8a..3f49e3c0652 100755 --- a/scripts/committer +++ b/scripts/committer @@ -216,7 +216,7 @@ fi committed=false if [ "$fast_commit" = true ]; then declare -a commit_env=(FAST_COMMIT=1) - if run_git_with_lock_retry "commit" env "${commit_env[@]}" git commit -m "$commit_message"; then + if run_git_with_lock_retry "commit" env "${commit_env[@]}" git commit --no-verify -m "$commit_message"; then committed=true fi else diff --git a/test/scripts/committer.test.ts b/test/scripts/committer.test.ts index 09cfc023dc0..7611c4e09c8 100644 --- a/test/scripts/committer.test.ts +++ b/test/scripts/committer.test.ts @@ -172,18 +172,18 @@ describe("scripts/committer", () => { expect(committedPaths(repo)).toEqual(["note.txt"]); }); - it("passes FAST_COMMIT through to git hooks when using --fast", () => { + it("bypasses git hooks when using --fast", () => { const repo = createRepo(); installHook( repo, ".githooks/pre-commit", - '#!/usr/bin/env bash\nset -euo pipefail\n[ "${FAST_COMMIT:-}" = "1" ] || exit 91\n', + "#!/usr/bin/env bash\nset -euo pipefail\nexit 91\n", ); writeRepoFile(repo, "note.txt", "hello\n"); - const output = commitWithHelperArgs(repo, "--fast", "test: fast hook env", "note.txt"); + const output = commitWithHelperArgs(repo, "--fast", "test: fast no verify", "note.txt"); - expect(output).toContain('Committed "test: fast hook env" with 1 files'); + expect(output).toContain('Committed "test: fast no verify" with 1 files'); expect(committedPaths(repo)).toEqual(["note.txt"]); });