commitlint:init commit-msg hook runs on each commit; you rarely invoke it directly.
Usage
Examples
Validate the message git is about to commit, exactly as the hook does:Options
| Option | Description | Default |
|---|---|---|
--file | Path to the commit message file to validate. | Required |
Rules
A message must take the formtype(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
commonor 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.
fixup!/squash!) messages are skipped. Install the hook that runs this check with commitlint:init.