Просмотр исходного кода

chore: hint how to fix fmt in pre-commit hook

Zaiming (Stone) Shi 3 лет назад
Родитель
Сommit
00198abfd7
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      scripts/git-hook-pre-commit.sh

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

@@ -11,4 +11,7 @@ if [[ "${files_dirty}" == '' ]] && [[ "${files_cached}" == '' ]]; then
 fi
 files="$(echo -e "${files_dirty} \n ${files_cached}" | xargs)"
 # shellcheck disable=SC2086
-./scripts/erlfmt $OPT $files
+if ! (./scripts/erlfmt $OPT $files); then
+    echo "EXECUTE 'make fmt' to fix" >&2
+    exit 1
+fi