Skip to content

Commit 7402d2f

Browse files
committed
travis: scancode check log instead
Fix to properly evaluate the findings - read the logs to get how many files there are reported.
1 parent 2d93a45 commit 7402d2f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,12 @@ matrix:
7777
after_success:
7878
- python ./tools/test/travis-ci/scancode-evaluate.py -f scancode.json
7979
- cat scancode-evaluate.log
80-
- retval=$?
80+
- COUNT=$(cat scancode-evaluate.log | grep File: | wc -l)
8181
- |
82-
if [ $retval == 0 ]; then
82+
if [ $COUNT == 0 ]; then
8383
echo "License check OK";
8484
else
8585
echo "License check failed, please review license issues found";
86-
COUNT=$(cat scancode-evaluate.log | grep File: | wc -l)
8786
STATUSM="Needs review, ${COUNT} license issues found";
8887
set_status "success" "$STATUSM";
8988
fi

tools/test/travis-ci/scancode-evaluate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def license_check(directory_name, file):
108108
userlog.warning("Found files with missing license details, please review and fix")
109109
for offender in offenders:
110110
userlog.warning("File: " + offender['file']['path'][len(directory_name):] + " " + "reason: " + offender['reason'])
111+
print(len(offenders))
111112
return len(offenders)
112113

113114
def parse_args():

0 commit comments

Comments
 (0)