Skip to content

Commit 24e30ab

Browse files
committed
spdx shouldnt be empty either
1 parent a277420 commit 24e30ab

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/build/style.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,19 @@ def check_spdx_header(lines):
5353
while i < len(lines) and not lines[i].strip():
5454
i += 1
5555

56-
if i >= len(lines) or not LICENSE_RE.match(lines[i]):
57-
errors.append((i + 1, "Missing or incorrect // license: header"))
56+
if i >= len(lines):
57+
errors.append((i + 1, "Missing // license: header"))
58+
elif not LICENSE_RE.match(lines[i]) or not lines[i].split(':', 1)[1].strip():
59+
errors.append((i + 1, "Incorrect or empty // license: header"))
5860

5961
i += 1
6062
while i < len(lines) and not lines[i].strip():
6163
i += 1
6264

63-
if i >= len(lines) or not COPYRIGHT_RE.match(lines[i]):
64-
errors.append((i + 1, "Missing or incorrect // copyright-holders: header"))
65+
if i >= len(lines):
66+
errors.append((i + 1, "Missing // copyright-holders: header"))
67+
elif not COPYRIGHT_RE.match(lines[i]) or not lines[i].split(':', 1)[1].strip():
68+
errors.append((i + 1, "Incorrect or empty // copyright-holders: header"))
6569

6670
return errors
6771

0 commit comments

Comments
 (0)