Skip to content

fluxdiv/cc_validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cc_validator

A githook that validates commit messages follow a (modified) conventional commit spec

Requirements

  • python3
  • git
  • curl

Setup

Option 1)

Run the installation script from your repo's root

curl -fsSL https://raw.githubusercontent.com/fluxdiv/cc_validator/main/installer.py | python3

This does the following:

  • Verifies the repo is a git repo
  • Checks whether git hooks have already been set up
  • If they have, the hook will be setup the same way
  • If not, a ~/my_repo_root/.githooks/ dir is created, and is added to the repo's git config via git config core.hooksPath .githooks
  • The commit-msg hook is created/copied and set as executable
  • Setup complete, commits will not be allowed unless they follow the spec

Option 2)

Setup the hook manually:

  • Create a .githooks directory in the root of your repo
  • Create a .githooks/commit-msg file
  • Copy the contents of the commit-msg hook into the file
  • Set as executable chmod a+x .githooks/commit-msg
  • Set the repo's git config to use it git config core.hooksPath .githooks
  • Setup complete

About

githook that validates commit messages follow a (modified) conventional commit spec

Resources

Stars

Watchers

Forks

Contributors

Languages