|
@@ -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
|