diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-08-02 20:03:43 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-08-12 10:14:00 +0300 |
commit | 18a13ef9e1f494cc4ee765ed1cacea894c5c3823 (patch) | |
tree | 5824fc9ab4eed76abb7f18d8f1a6560a0b18d58a /scripts | |
parent | Add libk tests (diff) | |
download | kernel-18a13ef9e1f494cc4ee765ed1cacea894c5c3823.tar.xz |
Add LICENSE.md
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check-header.py | 23 |
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) |