Lint your commits per conventional commits specification
Use this in post-commit hook and in your pipelines.
Requires:
- cat
- grep
- head
- mktemp
- sh
Portable! Works with gnu-coreutils, busybox, toybox.
commitlint
fails with nonzero exit status if the provided commit subject
doesn't conform conventionalcommits spec.
# good
echo "fix: some bugz" | commitlint
# bad
echo "malformed" | commitlint
commitlint "malformed"
# example CI usage
git show --no-patch --pretty='format:%s' "${REF:-HEAD}" | commitlint