Allow /* */ comments for license headers

This commit is contained in:
Max Radermacher 2026-04-27 15:10:31 -05:00 committed by GitHub
parent c70ae07f0f
commit fd68cef55d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,8 +5,8 @@ import argparse
import re
import sys
COPYRIGHT_LINE_RE = re.compile(r"^// Copyright 2\d\d\d Signal Messenger, LLC\n$")
SPDX_LINE = "// SPDX-License-Identifier: AGPL-3.0-only\n"
COPYRIGHT_LINE_RE = re.compile(r"^(//| \*) Copyright 2\d\d\d Signal Messenger, LLC\n$")
SPDX_LINE_RE = re.compile(r"^(//| \*) SPDX-License-Identifier: AGPL-3.0-only\n$")
def has_shebang(line: str) -> bool:
@ -26,9 +26,11 @@ def has_valid_license_header(path: Path) -> bool:
if COPYRIGHT_LINE_RE.match(line) is not None:
copyright_len += 1
continue
if line == SPDX_LINE:
if SPDX_LINE_RE.match(line) is not None:
license_len += 1
continue
if line.startswith("/*"):
continue
if line.startswith("//"):
continue
break