Husky

Build Status

Git hooks made easy

Description

Husky is an elixir version of the husky npm module.

Husky can prevent bad git commit, git push and more 🐶 ❤️ woof!

Installation

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

defp deps do
  [
    {:husky, "~> 1.0", only: :dev, runtime: false}
  ]
end

Usage

Configure Git Hooks Using config/config.exs:
use Mix.Config
config :husky,
    pre_commit: "mix format && mix credo --strict",
    pre_push: "mix format --check-formatted && mix credo --strict && mix test"

View example file config.example.exs

.husky.json

##### Configure Git Hooks Using `.husky.json`: ```JSON { "husky": { "hooks": { "pre_commit": "mix format && mix credo --strict", "pre_push": "mix format --check-formatted && mix credo --strict && mix test" } } } ``` View example file [.husky.example.json](./priv/.husky.example.json)

With the above setup:

Skip script install
export HUSKY_SKIP_INSTALL=true
Delete

Documentation can found at https://hexdocs.pm/husky.

Contributing

See the development README.md