diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-boilerplate | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/check-boilerplate b/scripts/check-boilerplate new file mode 100755 index 00000000..311f95b8 --- /dev/null +++ b/scripts/check-boilerplate @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import glob +import os +import sys + +for file in glob.glob('src/*.h'): + for line in open(file).readlines(): + if line.find('@file') != -1: + filename = line.strip().split()[2] + if filename != file: + print(f'AWOOGA: {file} {filename}') + sys.exit(1) + elif line.find('ifndef') != -1: + guard = line.strip().split()[1] + if not guard.startswith('LIBDCP'): + print(f'AWOOGA: {file} {guard}') + sys.exit(1) + correct_guard = 'LIBDCP_' + os.path.basename(file).upper().replace('.', '_') + if guard != correct_guard: + print(f'AWOOGA: {file} {guard} {correct_guard}') + sys.exit(1) + |
