Skip to content

Commit 40102fe

Browse files
Keen Yee Liauayazhafiz
authored andcommitted
ci: report error if files are not formatted
The current script skips over formatting checks if CI_MODE is true.
1 parent 790d0e7 commit 40102fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/format.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ find . -name "*.ts" \
1212
find syntaxes/ -name "*.json" \
1313
-exec yarn prettier --write {} +
1414

15-
if [[ ! -z "${CI_MODE}" ]]; then
16-
git diff --diff-filter=ACMRT --exit-code || (echo "Files not formatted; please run 'yarn format'." && exit 1)
15+
if [[ -n "$(git status --porcelain)" ]]; then
16+
echo "Files not formatted; please run 'yarn format'."
17+
exit 1
1718
fi

0 commit comments

Comments
 (0)