ENH: Add pre-commit hook to enforce ITK commit message conventions#303
Open
hjmjohnson wants to merge 1 commit intomainfrom
Open
ENH: Add pre-commit hook to enforce ITK commit message conventions#303hjmjohnson wants to merge 1 commit intomainfrom
hjmjohnson wants to merge 1 commit intomainfrom
Conversation
Add pre-commit hooks in Utilities/Hooks/ matching ITK's directory structure and commit message enforcement: - prepare-commit-msg: Inserts ITK prefix instructions into the commit message editor so developers see valid prefixes while composing. - kw-commit-msg.py: Validates commit messages with the same rules as upstream ITK: prefix check (BUG/COMP/DOC/ENH/PERF/STYLE/WIP), subject line max 78 chars, no leading/trailing whitespace, empty second line, and Merge/Revert exemptions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a476e37 to
a8b19f3
Compare
dzenanz
reviewed
Apr 4, 2026
Member
dzenanz
left a comment
There was a problem hiding this comment.
Looks good on a glance. Preferably someone else should review too.
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.
Summary
commit-msgpre-commit hook that validates commit messages follow the ITK convention:PREFIX: Description(e.g.,ENH: Add new feature)BUG:,COMP:,DOC:,ENH:,PERF:,STYLE:Test plan
pip install pre-commit && pre-commit install --hook-type commit-msgENH: Test featureis acceptedadd thingis rejected with a helpful error🤖 Generated with Claude Code