Enforcing Conventional Commits using Git hooks

1 · Enda · June 10, 2019, midnight
I’m a huge fan of Conventional Commits. This relatively young specification provides a set of rules for creating an explicit, standardised commit history. I’ve tried my best to follow the convention in all my projects. When I’m running low on caffeine I sometimes forget to follow the convention or a I let a typo slip past my eyes. To resolve this, I decided to create a dynamic commit-msg Git hook which automatically validates my commit message, and prevents them from being committed if any of th...