aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-08-02 20:03:43 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-08-12 10:14:00 +0300
commit18a13ef9e1f494cc4ee765ed1cacea894c5c3823 (patch)
tree5824fc9ab4eed76abb7f18d8f1a6560a0b18d58a /scripts
parentAdd libk tests (diff)
downloadkernel-18a13ef9e1f494cc4ee765ed1cacea894c5c3823.tar.xz
Add LICENSE.md
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-header.py23
1 files changed, 23 insertions, 0 deletions
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)