diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-28 01:17:34 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-28 01:17:34 +0000 |
commit | 1f7b4176c3b8db732c8cc1842283d78908aa9cf6 (patch) | |
tree | 49cc14bc3e6da5c15c39da34ded77b5002c23866 /PRESUBMIT.py | |
parent | fc0979236d0331d382de7db304855f7440906a6c (diff) | |
download | chromium_src-1f7b4176c3b8db732c8cc1842283d78908aa9cf6.zip chromium_src-1f7b4176c3b8db732c8cc1842283d78908aa9cf6.tar.gz chromium_src-1f7b4176c3b8db732c8cc1842283d78908aa9cf6.tar.bz2 |
Use the newly added CheckLicense() canned check to verify license boiler plate on source files.
Don't check for the year since there was no clear concensus about systematically updating the year on every change.
TEST=none
BUG=28291
Review URL: http://codereview.chromium.org/552203
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index b4b1c98..706f194 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -1,4 +1,4 @@ -# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -15,7 +15,17 @@ EXCLUDED_PATHS = ( ) -def CheckChangeOnUpload(input_api, output_api): +_LICENSE_HEADER = ( + r".*? Copyright \(c\) 20\d\d The Chromium Authors\. All rights reserved\." + "\n" + r".*? Use of this source code is governed by a BSD-style license that can " + "be\n" + r".*? found in the LICENSE file\." + "\n" +) + + +def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and @@ -38,27 +48,20 @@ def CheckChangeOnUpload(input_api, output_api): input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) + results.extend(input_api.canned_checks.CheckLicense( + input_api, output_api, _LICENSE_HEADER, sources)) + return results + + +def CheckChangeOnUpload(input_api, output_api): + results = [] + results.extend(_CommonChecks(input_api, output_api)) return results def CheckChangeOnCommit(input_api, output_api): results = [] - black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS - sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) - results.extend(input_api.canned_checks.CheckLongLines( - input_api, output_api, sources)) - results.extend(input_api.canned_checks.CheckChangeHasNoTabs( - input_api, output_api, sources)) - results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( - input_api, output_api, sources)) - results.extend(input_api.canned_checks.CheckChangeHasBugField( - input_api, output_api)) - results.extend(input_api.canned_checks.CheckChangeHasTestField( - input_api, output_api)) - results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( - input_api, output_api, sources)) - results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( - input_api, output_api)) + results.extend(_CommonChecks(input_api, output_api)) # TODO(thestig) temporarily disabled, doesn't work in third_party/ #results.extend(input_api.canned_checks.CheckSvnModifiedDirectories( # input_api, output_api, sources)) |