Skip to the cargo

hk util check-conventional-commit ​

  • How to hail it: hk util check-conventional-commit [--allowed-types <ALLOWED_TYPES>] [--allowed-scopes <ALLOWED_SCOPES>] <COMMIT_MSG_FILE>
  • Effect: read-only (looks, never touches)

Checks that the name ye christen her with (the commit message) follows the Conventional Commits format.

Titles starting with fixup! , squash! , or amend! (temporary commits made for git rebase --autosquash) skip validation and are waved through, as are the names git christens its own voyages: Merge branch ', Merge branches ', Merge tag ', Merge tags ', Merge commit ', Merge remote-tracking branch ', Merge remote-tracking branches ', Merge pull request , and Revert ".

Cargo it takes ​

  • <COMMIT_MSG_FILE> — The commit message file to check

Flags to fly ​

  • --allowed-types <ALLOWED_TYPES> — Comma-separated list of commit types to accept

    Unless ye say otherwise: build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test

  • --allowed-scopes <ALLOWED_SCOPES> — Accepted scopes, separated by commas; voyages without a scope may always sail

    Unless ye say otherwise, any scope is accepted. An empty list lets only unscoped voyages sail.

  • -h --help — Print help, for when ye've lost yer bearings

Tales from the deck ​

Check a file holding a commit message, such as "feat: hoist the sails".

sh
hk util check-conventional-commit .git/COMMIT_EDITMSG

Further charts ​

Built-in linters and utilities: the standing crew · Troubleshooting: the ship's log · All the bosun's calls

MIT LicenseCopyright © 2026jdx.dev