atypical-commit
Commit message linting: a parser library and the commit-lint binary.
commit-lint
Lints the commit message header against
<keyword>[<modifier>][(<scope>)][<reason>]: <description>,
e.g. add(exe)[int]: initial commit linting.
Install
Usage
Pass a commit message file, or - to read from stdin:
|
Exit codes: 0 valid, 1 failed linting (or unreadable input),
2 usage error or nothing to lint.
Configuration
Every part of the syntax comes from the [commit] section of the
nearest atypical.toml, found from the working directory upward
(or passed with --config <FILE>). If no config is found, or keys are
omitted, the standard preset is used (shown here in full):
[]
= ["add", "rem", "ref", "fix", "undo", "release"]
= ["?", "!", "!!"]
= ":"
= "pre" # before the enclosures, or "post"
# Scopes; omit `allowed` to accept anything between the delimiters.
[[]]
= ["(", ")"]
= ["exe", "lib", "test", "build", "doc", "ci", "cd"]
# Reasons.
[[]]
= ["[", "]"]
= [
"int", "pre", "eff", "rel", "cmp", "mnt", "tmp",
"exp", "sec", "upg", "ux", "pol", "sty",
]
As a commit-msg hook
With husky, in .husky/commit-msg:
Or as a plain git hook, in .git/hooks/commit-msg (mark it executable):
#!/bin/sh
License
MIT OR Apache-2.0