commit-verify
Auto commit message format verify hook
Usage
pnpm add -D commit-verify
Add verify command cv
to husky hook file .husky/commit-msg
:
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install cv $1
Config
example:
const { defineConfig } = require('commit-verify')
module.exports = defineConfig({
emoji: true,
})
Available configuration
emoji
whether auto add emoji to commit msg
feat(scope): msg -> feat(scope)🍉: msg
feat(scope): msg -> feat(scope): msg 🍉
emojiList
- default:
['🍓', '🍉', '🍇', '🍒', '🍡', '🍥', '🍩', '🍰', '🍭', '🌸', '🌈']
will add random emoji list
emojiPos
-
default: start
-
enum: start
| end
will add emoji position in commit msg
format
allow commit msg format.
default support:
-
github Merge
/ Revert
-
common commit type
-
changesets Version Packages
transformer
custom commit msg transoform on format regex check after
Command line
Following options are supported for command line use:
example:
npx --no-install cv $1 --emoji --emoji-pos=end
License
MIT