Преглед изворни кода

build: always check mix style

zmstone пре 1 година
родитељ
комит
018d72892d
1 измењених фајлова са 4 додато и 2 уклоњено
  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
 fi
 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
     # shellcheck disable=SC2086
     ./scripts/erlfmt -w $files
 else
-    # mix format check is quite fast
-    which mix && mix format --check-formatted
     # shellcheck disable=SC2086
     if ! (./scripts/erlfmt -c $files); then
         echo "EXECUTE 'make fmt-diff' to fix" >&2