Update boilerplate.py to support 2017

pull/6/head
Jeff Grafton 2017-01-01 13:37:39 -08:00
parent f5d9c430e9
commit 98534200bc
1 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ def file_passes(filename, refs, regexs):
print('File %s is missing the year' % filename, file=verbose_out) print('File %s is missing the year' % filename, file=verbose_out)
return False return False
# Replace all occurrences of the regex "2016|2015|2014" with "YEAR" # Replace all occurrences of the regex "2017|2016|2015|2014" with "YEAR"
p = regexs["date"] p = regexs["date"]
for i, d in enumerate(data): for i, d in enumerate(data):
(data[i], found) = p.subn('YEAR', d) (data[i], found) = p.subn('YEAR', d)
@ -175,8 +175,8 @@ def get_regexs():
regexs = {} regexs = {}
# Search for "YEAR" which exists in the boilerplate, but shouldn't in the real thing # Search for "YEAR" which exists in the boilerplate, but shouldn't in the real thing
regexs["year"] = re.compile( 'YEAR' ) regexs["year"] = re.compile( 'YEAR' )
# dates can be 2014, 2015 or 2016, company holder names can be anything # dates can be 2014, 2015, 2016, or 2017; company holder names can be anything
regexs["date"] = re.compile( '(2014|2015|2016)' ) regexs["date"] = re.compile( '(2014|2015|2016|2017)' )
# strip // +build \n\n build constraints # strip // +build \n\n build constraints
regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE) regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE)
# strip #!.* from shell scripts # strip #!.* from shell scripts