diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-02-07 00:51:08 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-04-18 12:11:43 +0200 |
| commit | 3d53fb23efa153e10c37071a4ecac48b74c2dbd6 (patch) | |
| tree | 2125f28506416ae362e660104f878898c51ef45d /scripts | |
| parent | 6801a43a489b3e55ab062b0db46e0e03d20e9bcb (diff) | |
Cleanup: fix more comments/guards (and add check script).
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) + |
