File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 4
4
needs_compile || exit 0
5
5
6
6
function perform_lint() {
7
+ echo " Performing LINT..."
7
8
CLANG_FORMAT=clang-format-3.9
8
9
if [ " $TRAVIS_EVENT_TYPE " = " pull_request" ]; then
9
10
# Get list of every file modified in this pull request
@@ -17,29 +18,31 @@ function perform_lint() {
17
18
local fail=0
18
19
for f in ${files_to_lint} ; do
19
20
d=$( diff -u " $f " <( ${CLANG_FORMAT} " $f " ) || true)
21
+
20
22
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 "
23
26
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"
25
28
else
26
- printf " %s\n" " $d "
29
+ printf " :\n %s\n" " $d "
27
30
fi
28
31
# Disable build failure at this moment as we need to have a complete MT source whitelist to check
29
32
fail=0
30
33
fi
31
34
done
32
35
33
36
if [ " $fail " = 1 ]; then
37
+ echo " LINT reports failure."
34
38
exit 1
35
39
fi
36
-
37
- exit 0
38
40
}
39
41
40
42
if [[ " $LINT " == " 1" ]]; then
41
43
# Lint with exit CI
42
44
perform_lint
45
+ exit 0
43
46
fi
44
47
45
48
if [[ $PLATFORM == " Unix" ]]; then
You can’t perform that action at this time.
0 commit comments