Skip to main content
Lints a commit message file against the project’s conventional-commit rules and exits non-zero — which aborts the commit — when the message is invalid, printing the specific violations. This is the command the commitlint:init commit-msg hook runs on each commit; you rarely invoke it directly.

Usage

talos commitlint:check --file <commit-message-file>

Examples

Validate the message git is about to commit, exactly as the hook does:
talos commitlint:check --file .git/COMMIT_EDITMSG

Options

OptionDescriptionDefault
--filePath to the commit message file to validate.Required

Rules

A message must take the form type(scope): Subject:
  • type — one of build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test, in lower-case.
  • scope — required and lower-case, and either common or the name of a package or module directory in the workspace. Scopes are discovered automatically, so a new module or package is a valid scope with no config change. Multiple scopes are allowed (feat(app, shared): ...).
  • subject — non-empty, starts with an upper-case letter, and does not end with a period. The whole header must be 100 characters or fewer.
Merge, revert, and autosquash (fixup!/squash!) messages are skipped. Install the hook that runs this check with commitlint:init.