Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ inspired by [pre-commit](https://www.npmjs.com/package/pre-commit) on npm and
[pre_commit_hook](https://hex.pm/packages/pre_commit_hook) for Elixir.

We wanted something which was configurable with your own mix commands and just
in Elixir, so we created our own module.
in Elixir, so we created our own module. This module will only work with git
versions 2.13 and above.

The first step will be to add this module to your mix.exs.

Expand Down Expand Up @@ -49,3 +50,7 @@ in your pre-commit.
We like adding [credo](https://github.com/rrrene/credo) and
[coveralls](https://github.com/parroty/excoveralls) as well as `test`, to keep
our code consistent and well covered!

There is a [known issue](https://github.com/dwyl/elixir-pre-commit/issues/32)
with the fact that running the pre-commit will restore deleted files to the working
tree.
7 changes: 6 additions & 1 deletion lib/pre_commit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ defmodule PreCommit do
### THIS MODULE WILL OVERWRITE YOUR CURRENT PRE-COMMIT HOOKS

We wanted something which was configurable with your own mix commands and
just in elixir, so we created our own module.
just in elixir, so we created our own module. This module will only work
with git versions 2.13 and above.

The first step will be to add this module to your mix.exs.
```elixir
Expand Down Expand Up @@ -42,6 +43,10 @@ defmodule PreCommit do
We like adding [credo](https://github.com/rrrene/credo) and
[coveralls](https://github.com/parroty/excoveralls) as well as `test`, to
keep our code consistent and well covered!

There is a [known issue](https://github.com/dwyl/elixir-pre-commit/issues/32)
with the fact that running the pre-commit will restore deleted files to the working
tree.
"""
copy = Mix.Project.deps_path() |> Path.join("pre_commit/priv/pre-commit")
to = Mix.Project.deps_path() |> Path.join("../.git/hooks/pre-commit")
Expand Down