Skip to content

Check commit subjects in baseline hooks - #371

Open
tbhb-dev-agent-pull-requests[bot] wants to merge 1 commit into
mainfrom
agent/r22-commit-subject-hook
Open

tbhb-dev-agent-pull-requests[bot] wants to merge 1 commit into
mainfrom
agent/r22-commit-subject-hook

Conversation

@tbhb-dev-agent-pull-requests

Copy link
Copy Markdown

Why

The pull request check can reject a commit subject longer than 72 characters after CI starts. Consumer repositories need that feedback when they commit.

Behavior change

The Go, Python, docs, and chezmoi baselines require the Commit subject hook at the commit-msg stage. The hook calls @tbhb_rules//lint:commit_subject with Git's message file and skips the check when Git sets MERGE_HEAD.

Decisions

The Bazel target uses the same checker as the pull request check. It resolves relative message paths from the directory where the caller invoked Bazel. The manifest test compares commit-message hook IDs with each seed configuration.

Risk

Existing repositories need a rules release that exports the target and a hook configuration that calls it. The first run can take longer while Bazel builds the checker.

Verification

bazelisk test //:all //tools:vale_test //lint/... //repo/... //pins/... passed all 278 tests through the available coordinator gate at ~/gate-jobs/gate.sh. The requested gate path was absent.

bazelisk test //repo/baseline:manifest_test //tools:pytest_test passed both targets. In the consumer smoke workspace, the hook accepted a valid subject through a relative path and rejected an 81-character subject. With a simulated merge marker, the same hook skipped the check.

Generated-by: LLM harness=codex;model=openai:gpt-6.2-sol
Generated-by: LLM effort=high;harness=codex:0.166.0;model=openai:gpt-6.2-sol;session=sha-256-64:f69140126b1ce172;surface=exec
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