Skip to content

Commit aa5549e

Browse files
authoredMar 26, 2017
clang-format: limit diff to 50 files to prevent exceding the maximum travis output (4MB) (#5455)
1 parent 1139a18 commit aa5549e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎util/travis/script.sh

+7
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ function perform_lint() {
1313
files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h' | egrep -v '^src/(gmp|lua|jsoncpp)/')"
1414
fi
1515

16+
local errorcount=0
1617
local fail=0
1718
for f in ${files_to_lint}; do
1819
d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true)
1920
if ! [ -z "$d" ]; then
21+
((errorcount++))
2022
printf "The file %s is not compliant with the coding style:\n%s\n" "$f" "$d"
23+
if [ ${errorcount} -gt 50 ]; then
24+
printf "Too many errors encountered previously, this diff is hidden.\n"
25+
else
26+
printf "%s\n" "$d"
27+
fi
2128
# Disable build failure at this moment as we need to have a complete MT source whitelist to check
2229
fail=0
2330
fi

0 commit comments

Comments
 (0)
Please sign in to comment.