in tools/check_boilerplate.py [0:0]
def main(paths, scan_files=False):
"Cycle through files in paths and check for the Apache 2.0 boilerplate."
errors, warnings = [], []
if scan_files:
check_files("./", paths, errors, warnings)
else:
for dir in paths:
for root, dirs, files in os.walk(dir):
dirs[:] = [d for d in dirs if d not in _EXCLUDE_DIRS]
check_files(root, files, errors, warnings)
if warnings:
print('The following files cannot be accessed:')
print('\n'.join(' - {}'.format(s) for s in warnings))
if errors:
print('The following files are missing the license boilerplate:')
print('\n'.join(' - {}'.format(s) for s in errors))
sys.exit(1)