6 mit_copyright = open(
"scripts/copyright_mit.txt",
'r').read()
12 for line
in mit_copyright.split(
'\n')[:-1]:
14 if line.strip() !=
"":
15 out.write(
" %s" %line)
18 out.write(content.strip())
25 for line
in mit_copyright.split(
'\n')[:-1]:
27 if line.strip() !=
"":
28 out.write(
" %s" %line)
30 out.write(content.strip())
37 for line
in content.split(
'\n'):
39 if line.startswith(
' */'):
41 elif line.startswith(
'/*')
or line.startswith(
' *'):
45 raise Exception(
"ERROR: not a comment ? '%s'"% line)
52 for line
in content.split(
'\n'):
53 if comment
and line.startswith(
'#'):
61 root, f = os.path.split(path)
62 if f
in [
'.clang-tidy',
'.clang-format']:
63 print(
"Skipping file: {}".
format(path))
66 with open(path,
'r', encoding=
'utf-8')
as fd:
68 _, extension = os.path.splitext(f)
70 if extension
in [
'.cpp',
'.h',
'.hpp',
'.inl',
'.cl',
'.in',
'.cs']:
71 if not content.startswith(
'/*'):
73 elif extension ==
'.py' or f
in [
'SConstruct',
'SConscript']:
74 if not content.startswith(
'# Copyright'):
76 elif f ==
'CMakeLists.txt':
77 if not content.startswith(
'# Copyright'):
80 raise Exception(
"Unhandled file: {}".
format(path))
83 for path
in sys.argv[1:]:
86 for top
in [
'./arm_compute',
'./tests',
'./src',
'./examples',
'./utils/',
'./opencl-1.2-stubs/',
'./opengles-3.1-stubs/',
'./support']:
87 for root, _, files
in os.walk(top):
89 path = os.path.join(root, f)