Update header regexp to prevent year ranges

This commit is contained in:
Leo Balter 2019-07-15 13:00:30 -04:00 committed by Rick Waldron
parent f7e6656c13
commit 8b28871eca
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class CheckLicense(Check):
match = _LICENSE_PATTERN.search(source) match = _LICENSE_PATTERN.search(source)
if not match: if not match:
return return 'Invalid Copyright header'
year_str = match.group(2) year_str = match.group(2)
try: try:

View File

@ -17,7 +17,7 @@ _YAML_PATTERN = re.compile(r"/\*---(.*)---\*/" + _BLANK_LINES, re.DOTALL)
# Matches all known variants for the license block. # Matches all known variants for the license block.
_LICENSE_PATTERN = re.compile( _LICENSE_PATTERN = re.compile(
r'// Copyright( \(C\))? (\w+) .+\. {1,2}All rights reserved\.[\r\n]{1,2}' + r'// Copyright( \([C]\))? (\w+) .+\. {1,2}All rights reserved\.[\r\n]{1,2}' +
r'(' + r'(' +
r'// This code is governed by the( BSD)? license found in the LICENSE file\.' + r'// This code is governed by the( BSD)? license found in the LICENSE file\.' +
r'|' + r'|' +