Skip to content

Commit

Permalink
Allow public domain dedications
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Oct 31, 2024
1 parent 567cfa0 commit 895fb36
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/lint/lib/checks/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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:
Expand Down

0 comments on commit 895fb36

Please sign in to comment.