Add support for skipping license checks

Signed-off-by: James Munnelly <james.munnelly@jetstack.io>
This commit is contained in:
James Munnelly 2018-08-13 15:47:17 +01:00
parent e1fd5caa7e
commit 1c2380f7b4

View File

@ -1,5 +1,7 @@
#!/usr/bin/env python
# +skip_license_check
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -119,7 +121,9 @@ SKIPPED_DIRS = [
# even when generated by bazel we will complain about some generated files
# not having the headers. since they're just generated, ignore them
IGNORE_HEADERS = [
'// Code generated by go-bindata.'
'// Code generated by go-bindata.',
'// +skip_license_check',
'# +skip_license_check',
]
@ -127,7 +131,7 @@ def has_ignored_header(pathname):
with open(pathname, 'r') as myfile:
data = myfile.read()
for header in IGNORE_HEADERS:
if data.startswith(header):
if header in data:
return True
return False