Introduce a bit of sanity to talk/PRESUBMIT.py's license checking.

The comma this allows is a very common variant of the license header (3:1
preferred over the no-comma variant in talk/).

Also pacify pylint a bit, and correct a flagrantly incorrect header I happened
to come across.

BUG=2098,2133
R=henrike@webrtc.org, niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1866004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4396 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org
2013-07-25 16:43:30 +00:00
parent 9fbc558dd4
commit 33584f942c
6 changed files with 9 additions and 5 deletions

View File

@ -25,13 +25,13 @@
def _LicenseHeader(input_api):
"""Returns the license header regexp."""
# Accept any year number from 2011 to the current year
# Accept any year number from 2008 to the current year
current_year = int(input_api.time.strftime('%Y'))
allowed_years = (str(s) for s in reversed(xrange(2008, current_year + 1)))
years_re = '(' + '|'.join(allowed_years) + ')'
license_header = (
r'.*? libjingle\n'
r'.*? Copyright %(year)s Google Inc\.\n'
r'.*? Copyright %(year)s,? Google Inc\.\n'
r'.*?\n'
r'.*? Redistribution and use in source and binary forms, with or without'
r'\n'