Skip to content

Say the Hook Header the Way the Body Already Says It - #645

Merged
ptr727 merged 1 commit into
developfrom
fix/hook-header-scope-wording
Aug 9, 2026
Merged

Say the Hook Header the Way the Body Already Says It#645
ptr727 merged 1 commit into
developfrom
fix/hook-header-scope-wording

Conversation

@ptr727

@ptr727 ptr727 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Answers the one finding on the promotion pull request #643, which cannot take a fix commit of its own: its head is develop, so the correction reaches it by landing here first.

The header comment says the hook runs doc checks "on the commit's own scope", but the script later documents (and implements) scope as the working tree diff against HEAD (not the index / staged content).

Accepted. The header named the staged content where the hook evaluates the working tree diff against HEAD. The body of the same file already said so, and said why, so the header was the single line disagreeing both with the implementation and with the three sentences under it. That is the worse shape of the two, since a reader who stops at the header gets a wrong answer that the file itself contradicts further down.

It now says each gate runs at the scope that fits it, which is what the file documents and what #642 settled: the prose gate is diff-scoped against HEAD, and the line-ending check is repo-wide because it reads .gitattributes against .editorconfig and takes no file list.

The hook ran on this commit and exits 0.

🤖 Generated with Claude Code

The header read "on the commit's own scope", which names the staged content, where
the hook evaluates the working tree diff against HEAD. The body of the same file
already says so, and says why, so the header was the one line disagreeing with the
implementation and with the three sentences below it.

It now says each gate runs at the scope that fits it, which is what the file
documents and what #642 settled: the prose gate is diff-scoped, the line-ending
check is repo-wide.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 9, 2026 17:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the .husky/pre-commit hook’s header comment so it no longer contradicts the hook’s documented/implemented scoping behavior (diff-scoped prose checks vs repo-wide EOL checks).

Changes:

  • Adjust the header comment to describe that each gate runs at the scope appropriate to the check, aligning with the rest of the file’s documentation and behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727
ptr727 merged commit 765969e into develop Aug 9, 2026
7 checks passed
@ptr727
ptr727 deleted the fix/hook-header-scope-wording branch August 9, 2026 18:06
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.

2 participants