mirror of https://github.com/ARMmbed/mbed-os.git
scancode: skip non code files
For instance pdf, or binaries - catch them as an exception and skip for additional SPDX checkpull/12437/head
parent
db989ba65a
commit
37a7ff0443
|
@ -81,7 +81,8 @@ def license_check(directory_name, file):
|
|||
found_spdx = True
|
||||
|
||||
if not found_spdx:
|
||||
# Issue reported reported here https://github.com/nexB/scancode-toolkit/issues/1913
|
||||
try:
|
||||
# Issue reported here https://github.com/nexB/scancode-toolkit/issues/1913
|
||||
# We verify here if SPDX is not really there as SDPX is part of the license text
|
||||
# scancode has some problems detecting it properly
|
||||
with open(os.path.join(os.path.abspath(license_offender['file']['path'])), 'r') as spdx_file_check:
|
||||
|
@ -91,7 +92,9 @@ def license_check(directory_name, file):
|
|||
continue
|
||||
license_offender['reason'] = MISSING_SPDX_TEXT
|
||||
offenders.append(license_offender)
|
||||
|
||||
except UnicodeDecodeError:
|
||||
# not valid file for license check
|
||||
continue
|
||||
except KeyError:
|
||||
userlog.warning("Invalid scancode json file")
|
||||
return -1
|
||||
|
|
Loading…
Reference in New Issue