File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ matrix:
82
82
echo "License check OK";
83
83
else
84
84
echo "License check failed, please review license issues found";
85
- STATUSM="Needs review, ${retval} license issues found";
85
+ COUNT=$(cat scancode-evaluate.log | grep File: | wc -l)
86
+ STATUSM="Needs review, ${COUNT} license issues found";
86
87
set_status "success" "$STATUSM";
87
88
fi
88
89
Original file line number Diff line number Diff line change 32
32
33
33
userlog = logging .getLogger ("scancode-evaluate" )
34
34
userlog .setLevel (logging .INFO )
35
+ logfile = os .path .join (os .getcwd (), 'scancode-evaluate.log' )
36
+ log_file_handler = logging .FileHandler (logfile , mode = 'w' )
37
+ userlog .addHandler (log_file_handler )
35
38
36
39
MISSING_LICENSE_TEXT = "Missing license header"
37
40
MISSING_PERMISIVE_LICENSE_TEXT = "Non-permissive license"
@@ -120,7 +123,11 @@ def parse_args():
120
123
121
124
args = parse_args ()
122
125
if args .file and os .path .isfile (args .file ):
123
- sys .exit (license_check (args .directory_name , args .file ))
126
+ count = license_check (args .directory_name , args .file )
127
+ if count == 0 :
128
+ sys .exit (0 )
129
+ else :
130
+ sys .exit (- 1 )
124
131
else :
125
132
userlog .warning ("Could not find the scancode json file" )
126
133
sys .exit (- 1 )
You can’t perform that action at this time.
0 commit comments