Skip to content

Commit 72ce9d7

Browse files
authoredMar 26, 2017
clang-format: fix counter increment & output (#5456)
clang-format: fix bash syntax on increment
1 parent aa5549e commit 72ce9d7

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed
 

Diff for: ‎util/travis/script.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
needs_compile || exit 0
55

66
function perform_lint() {
7+
echo "Performing LINT..."
78
CLANG_FORMAT=clang-format-3.9
89
if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then
910
# Get list of every file modified in this pull request
@@ -17,29 +18,31 @@ function perform_lint() {
1718
local fail=0
1819
for f in ${files_to_lint}; do
1920
d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true)
21+
2022
if ! [ -z "$d" ]; then
21-
((errorcount++))
22-
printf "The file %s is not compliant with the coding style:\n%s\n" "$f" "$d"
23+
errorcount=$((errorcount+1))
24+
25+
printf "The file %s is not compliant with the coding style" "$f"
2326
if [ ${errorcount} -gt 50 ]; then
24-
printf "Too many errors encountered previously, this diff is hidden.\n"
27+
printf "\nToo many errors encountered previously, this diff is hidden.\n"
2528
else
26-
printf "%s\n" "$d"
29+
printf ":\n%s\n" "$d"
2730
fi
2831
# Disable build failure at this moment as we need to have a complete MT source whitelist to check
2932
fail=0
3033
fi
3134
done
3235

3336
if [ "$fail" = 1 ]; then
37+
echo "LINT reports failure."
3438
exit 1
3539
fi
36-
37-
exit 0
3840
}
3941

4042
if [[ "$LINT" == "1" ]]; then
4143
# Lint with exit CI
4244
perform_lint
45+
exit 0
4346
fi
4447

4548
if [[ $PLATFORM == "Unix" ]]; then

0 commit comments

Comments
 (0)
Please sign in to comment.