chore: add local DCO check via pre-commit commit-msg hook#1131
Merged
psschwei merged 1 commit intoMay 22, 2026
Conversation
Adds a commit-msg-stage hook that fails commits missing a Signed-off-by trailer, surfacing the same check the GitHub DCO bot enforces at PR time. default_install_hook_types ensures `pre-commit install` wires up both pre-commit and commit-msg hooks on fresh clones. Assisted-by: Claude Code Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
akihikokuroda
approved these changes
May 21, 2026
auto-merge was automatically disabled
May 22, 2026 13:32
Pull request was closed
Merged
via the queue into
generative-computing:main
with commit May 22, 2026
9bbf25d
13 checks passed
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.
Issue
Fixes #
Description
Adds a
commit-msg-stage pre-commit hook that fails commits missing aSigned-off-bytrailer, complementing the GitHub DCO bot enabled in #1129. Surfaces the same DCO check locally so contributors find out at commit time instead of after pushing.default_install_hook_types: [pre-commit, commit-msg]ensurespre-commit installwires up both hook types automatically — no special install flags needed.Existing contributors: re-run
pre-commit installonce after pulling this branch to pick up the newcommit-msghook.Long-time contributors: if your
.git/hooks/directory has leftoverpre-commit.legacyorpre-commit.oldfiles from previous migrations,pre-commit installwill detect them, enter migration mode, and silently skip installing the newcommit-msghook. After runningpre-commit install, check for.git/hooks/commit-msg— if it's missing, run the explicit form once:After that, future config changes are picked up automatically with no further action.
Testing
Manually verified on clean clones:
pre-commit installinstalls bothpre-commitandcommit-msghookspre-commit install) also installs both hooksgit commit -m "..."(no-s) fails withMissing Signed-off-by trailer. Use: git commit -sgit commit -s -m "..."passes the DCO checkAttribution
Adding a new component, requirement, sampling strategy, or tool?