commitlint icon indicating copy to clipboard operation
commitlint copied to clipboard

emoji config to convert "fix:" to "🐛" ?

Open oneezy opened this issue 2 years ago • 2 comments

I have a simple question and I hope someone can lead me in the right direction.

I have commitlint and a commitlint.config file working perfectly via .husky

I'm looking for a way to replace commit messages with emojis, ideally from a commitlint.config file

i.e. I want to be able to type out the word "fix:" and it's replaced with "🐛"

git commit -m "fix: got rid of the bug!"
will become...  🐛 got rid of the bug!

is this possible to setup through the commitlint.config somehow?

oneezy avatar May 26 '22 20:05 oneezy

Does this help?: https://github.com/arvinxx/gitmoji-commit-workflow

escapedcat avatar May 27 '22 03:05 escapedcat

From my understanding, commitlint does not modify the commit in any way. The best solution I can think of is another hook that will run before the linting on the commit-msg hook.

See: https://git-scm.com/docs/githooks#_commit_msg

AdeAttwood avatar May 27 '22 07:05 AdeAttwood

Provided info should be enough to make this work

escapedcat avatar Aug 25 '22 01:08 escapedcat