commitlint-rs
commitlint-rs copied to clipboard
Missing usage examples
I'm missing actual usage examples. I've been able to figure some things out via the --help flag but would love to see a commit-msg hook example at minimum.
Here's the commit-msg hook I set up:
#!/usr/bin/env sh
commitlint --edit "$1" || (printf "Your commit message was:\n\n%s\n" "$(cat "$1")" && exit 1)
A benefit of this hook is that it prints your commit message if linting fails. Not printing the commit message on lint failure has caused colleagues of mine to disable the linter in the past as they "lost" their message.