Presubmit: fix accepted copyright dates.

2006-2009/10 was a valid copyright date format before 2011 (when we decided to
use only one year, not a range).

The current directive with copyright is in fact to not change old copyright
dates, so there is no plan to go back and "fix" old files. As such, the
presubmit checks should not be complaining about old files.

BUG=none

Review URL: https://codereview.chromium.org/200643002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@257181 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
rvargas@chromium.org 11 years ago
parent 8da7f27a2c
commit 0265260484

@ -956,11 +956,11 @@ def PanProjectChecks(input_api, output_api,
project_name = project_name or 'Chromium' project_name = project_name or 'Chromium'
# Accept any year number from 2006 to the current year, or the special # Accept any year number from 2006 to the current year, or the special
# 2006-2008 string used on the oldest files. 2006-2008 is deprecated, but # 2006-20xx string used on the oldest files. 2006-20xx is deprecated, but
# tolerate it until it's removed from all files. # tolerated on old files.
current_year = int(input_api.time.strftime('%Y')) current_year = int(input_api.time.strftime('%Y'))
allowed_years = (str(s) for s in reversed(xrange(2006, current_year + 1))) allowed_years = (str(s) for s in reversed(xrange(2006, current_year + 1)))
years_re = '(' + '|'.join(allowed_years) + '|2006-2008)' years_re = '(' + '|'.join(allowed_years) + '|2006-2008|2006-2009|2006-2010)'
# The (c) is deprecated, but tolerate it until it's removed from all files. # The (c) is deprecated, but tolerate it until it's removed from all files.
license_header = license_header or ( license_header = license_header or (

Loading…
Cancel
Save