ci: check if Elixir files are formatted in pre-commit hook
This commit is contained in:
parent
cb3ef65775
commit
a55017ffaa
|
@ -4,6 +4,9 @@ set -euo pipefail
|
||||||
|
|
||||||
OPT="${1:--c}"
|
OPT="${1:--c}"
|
||||||
|
|
||||||
|
# mix format check is quite fast
|
||||||
|
mix format --check-formatted
|
||||||
|
|
||||||
files_dirty="$(git diff --name-only | grep -E '.*\.erl' || true)"
|
files_dirty="$(git diff --name-only | grep -E '.*\.erl' || true)"
|
||||||
files_cached="$(git diff --cached --name-only | grep -E '.*\.erl' || true)"
|
files_cached="$(git diff --cached --name-only | grep -E '.*\.erl' || true)"
|
||||||
if [[ "${files_dirty}" == '' ]] && [[ "${files_cached}" == '' ]]; then
|
if [[ "${files_dirty}" == '' ]] && [[ "${files_cached}" == '' ]]; then
|
||||||
|
|
Loading…
Reference in New Issue