From 895fb3601482cf3aa07263fa9b79d39e174cda79 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 31 Oct 2024 15:57:16 +0100 Subject: [PATCH] Allow public domain dedications --- tools/lint/lib/checks/license.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/lint/lib/checks/license.py b/tools/lint/lib/checks/license.py index 2dd73ee7c92..bfe8961c879 100644 --- a/tools/lint/lib/checks/license.py +++ b/tools/lint/lib/checks/license.py @@ -18,6 +18,14 @@ r'// See LICENSE or https://github\.com/tc39/test262/blob/HEAD/LICENSE' + r')', re.IGNORECASE) +_PD_PATTERN = re.compile( + r'/\*[\r\n]{1,2}' + + r' \* Any copyright is dedicated to the Public Domain.[\r\n]{1,2}' + + r' \* http://creativecommons.org/licenses/publicdomain/[\r\n]{1,2}' + + r' \*/[\r\n]{1,2}', + re.IGNORECASE +) + class CheckLicense(Check): '''Ensure tests declare valid license information.''' ID = 'LICENSE' @@ -29,6 +37,9 @@ def run(self, name, meta, source): if meta and 'flags' in meta and 'generated' in meta['flags']: return + if _PD_PATTERN.search(source): + return + match = _LICENSE_PATTERN.search(source) if not match: