From 18a13ef9e1f494cc4ee765ed1cacea894c5c3823 Mon Sep 17 00:00:00 2001 From: aqua Date: Tue, 2 Aug 2022 20:03:43 +0300 Subject: Add LICENSE.md --- scripts/check-header.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 scripts/check-header.py (limited to 'scripts') diff --git a/scripts/check-header.py b/scripts/check-header.py new file mode 100755 index 0000000..67aea38 --- /dev/null +++ b/scripts/check-header.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import sys +import re + +line_re = [ + r'^\/\/\={69}$', + r'^\/\/ \w+', + r'^\/\/ spdx-license-identifier: (ISC)', + r'^\/\/ description: \w+' +] + +if __name__ == '__main__': + errors = 0 + + with open(sys.argv[1]) as f: + for i in range(len(line_re)): + if re.search(line_re[i], f.readline()) == None: + print(f'wrong license header: {sys.argv[1]}:{i}') + errors += 1 + + if errors != 0: + sys.exit(1) -- cgit v1.2.1