mirror of https://github.com/tc39/test262.git
Allow public domain dedications
This commit is contained in:
parent
3468e6aa77
commit
d0bda4d26f
|
@ -18,6 +18,14 @@ _LICENSE_PATTERN = re.compile(
|
|||
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 @@ class CheckLicense(Check):
|
|||
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:
|
||||
|
|
Loading…
Reference in New Issue