Skip to content

andyl/commit_hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CommitHook

Mix tasks to enable/disable lint checks for Conventional Commit (CC) messages.

Learn more about Git Hooks and Conventional Commit messages.

Conventional Commit messages are essential for automated release management with tools like GitOps.

Installation

Manual Installation

The package can be installed by adding commit_hook to your list of dependencies in mix.exs:

def deps do
  [
    {:commit_hook, "~> 0.4.2"}
  ]
end

After running mix deps.get, you should run mix commit_hook.enable.

Installing with Igniter

This command will install the dependency and auto-enable the commit hook:

mix igniter.install commit_hook

Usage

Once installed, you can enable/disable the commit hook:

> mix commit_hook.enable 
> mix commit_hook.disable

Cloning Your Repo

Every developer who clones your repo will have to explicitly install the commit hook locally. Your commit hook settings can not be saved in your repo. This is an intentional design of the Git Hook system, intended to address security risks.

You may wish to add a note for developers in your README file:

## Git Hooks

We enforce Conventional Commit messages locally so the repo stays clean.

Learn more at [https://www.conventionalcommits.org](https://www.conventionalcommits.org).

After cloning, install the hook. Run once:

    > mix commit_hook.install

Related Tools

CommitHook is intended to be a very simple Elixir tool to add a CC lint check to your repo. There are other Elixir tools that configure commit hooks:

About

Enable/Disable Conventional Commit checks

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors