Skip to content

Commit fb9e2f4

Browse files
author
Keen Yee Liau
committed
ci: Check diff in format.sh only in CI mode
PR closes #405
1 parent c66a2d1 commit fb9e2f4

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ script:
1616
- ./scripts/lint.sh
1717
- ./scripts/build.sh
1818
- ./scripts/test.sh
19-
- ./scripts/format.sh && git diff --diff-filter=ACMRT --exit-code || (echo "Files not formatted; please run 'yarn format'." && exit 1)
19+
- ./scripts/format.sh
2020

2121
after_script:
2222
- ./scripts/cleanup.sh

scripts/e2e.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -ex -o pipefail
4+
35
export NG_DEBUG="true"
46
export CODE_TESTS_PATH="$(pwd)/integration/out/e2e"
57
export CODE_TESTS_WORKSPACE="$(pwd)/integration/project"

scripts/format.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ find . -name "*.ts" \
77
-not -path "*/node_modules/*" \
88
-not -path "*/out/*" \
99
-exec yarn clang-format -i {} +
10+
11+
if [[ ! -z "${CI_MODE}" ]]; then
12+
git diff --diff-filter=ACMRT --exit-code || (echo "Files not formatted; please run 'yarn format'." && exit 1)
13+
fi

0 commit comments

Comments
 (0)