From 00198abfd7ea5f6c5395b7cda5d5cf4728a8c506 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sat, 14 May 2022 12:18:55 +0200 Subject: [PATCH] chore: hint how to fix fmt in pre-commit hook --- scripts/git-hook-pre-commit.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/git-hook-pre-commit.sh b/scripts/git-hook-pre-commit.sh index dc4e13e93..a5e441d05 100755 --- a/scripts/git-hook-pre-commit.sh +++ b/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