Parcourir la source

build: always check mix style

zmstone il y a 1 an
Parent
commit
018d72892d
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      scripts/git-hook-pre-commit.sh

+ 4 - 2
scripts/git-hook-pre-commit.sh

@@ -12,12 +12,14 @@ if [[ "${files_dirty}" == '' ]] && [[ "${files_cached}" == '' ]]; then
     exit 0
     exit 0
 fi
 fi
 files="$(echo -e "${files_dirty} \n ${files_cached}" | xargs)"
 files="$(echo -e "${files_dirty} \n ${files_cached}" | xargs)"
+
+# mix format check is quite fast
+which mix && mix format --check-formatted
+
 if [ "${ERLFMT_WRITE:-false}" = 'true' ]; then
 if [ "${ERLFMT_WRITE:-false}" = 'true' ]; then
     # shellcheck disable=SC2086
     # shellcheck disable=SC2086
     ./scripts/erlfmt -w $files
     ./scripts/erlfmt -w $files
 else
 else
-    # mix format check is quite fast
-    which mix && mix format --check-formatted
     # shellcheck disable=SC2086
     # shellcheck disable=SC2086
     if ! (./scripts/erlfmt -c $files); then
     if ! (./scripts/erlfmt -c $files); then
         echo "EXECUTE 'make fmt-diff' to fix" >&2
         echo "EXECUTE 'make fmt-diff' to fix" >&2