Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: presubmit_canned_checks.py

Issue 10824191: New copyright boilerplate policy for presubmit: don't require the current year (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
===================================================================
--- presubmit_canned_checks.py (revision 150136)
+++ presubmit_canned_checks.py (working copy)
@@ -882,14 +882,23 @@
r'.+\.json$',
))
project_name = project_name or 'Chromium'
+
+ # 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
+ # tolerate it until it's removed from all files.
+ current_year = int(input_api.time.strftime('%Y'))
+ allowed_years = (str(s) for s in reversed(xrange(2006, current_year + 1)))
+ years_re = '(' + '|'.join(allowed_years) + '|2006-2008)'
+
+ # The (c) is deprecated, but tolerate it until it's removed from all files.
license_header = license_header or (
- r'.*? Copyright \(c\) %(year)s The %(project)s Authors\. '
+ r'.*? Copyright (\(c\) )?%(year)s The %(project)s Authors\. '
r'All rights reserved\.\n'
r'.*? Use of this source code is governed by a BSD-style license that '
r'can be\n'
r'.*? found in the LICENSE file\.(?: \*/)?\n'
) % {
- 'year': input_api.time.strftime('%Y'),
+ 'year': years_re,
'project': project_name,
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698