diff options
author | steveblock@chromium.org <steveblock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-01 15:50:29 +0000 |
---|---|---|
committer | steveblock@chromium.org <steveblock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-01 15:50:29 +0000 |
commit | 31eac5b5a5025e025b12d3719461f785848c55bb (patch) | |
tree | 3c5fc214f3e86d08c0da6c4069393bca3fffdb4b /third_party/PRESUBMIT.py | |
parent | f0a6f4bb3d6a54ab6435af16dd87314058a4b843 (diff) | |
download | chromium_src-31eac5b5a5025e025b12d3719461f785848c55bb.zip chromium_src-31eac5b5a5025e025b12d3719461f785848c55bb.tar.gz chromium_src-31eac5b5a5025e025b12d3719461f785848c55bb.tar.bz2 |
Make 'License' field in third-party metadata required
This will simplify the addition of a tool to check licenses for the purpose of
the Android WebView build.
See also http://codereview.chromium.org/10827099
Also adds other missing fields to these README.chromium files as required by
presubmit checks and fixes a regex used to enforce this.
BUG=138921
Review URL: https://chromiumcodereview.appspot.com/10821103
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/PRESUBMIT.py')
-rw-r--r-- | third_party/PRESUBMIT.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/third_party/PRESUBMIT.py b/third_party/PRESUBMIT.py index 8f142b7..6812a18 100644 --- a/third_party/PRESUBMIT.py +++ b/third_party/PRESUBMIT.py @@ -24,7 +24,7 @@ def _CheckThirdPartyReadmesUpdated(input_api, output_api): return errors name_pattern = input_api.re.compile( - r'^Name: [a-zA-Z0-9_\-\. ]+\r?$', + r'^Name: [a-zA-Z0-9_\-\. \(\)]+\r?$', input_api.re.IGNORECASE | input_api.re.MULTILINE) shortname_pattern = input_api.re.compile( r'^Short Name: [a-zA-Z0-9_\-\.]+\r?$', @@ -33,7 +33,10 @@ def _CheckThirdPartyReadmesUpdated(input_api, output_api): r'^Version: [a-zA-Z0-9_\-\.:]+\r?$', input_api.re.IGNORECASE | input_api.re.MULTILINE) release_pattern = input_api.re.compile( - r'Security Critical: (yes)|(no)\r?$', + r'^Security Critical: (yes)|(no)\r?$', + input_api.re.IGNORECASE | input_api.re.MULTILINE) + license_pattern = input_api.re.compile( + r'^License: .+\r?$', input_api.re.IGNORECASE | input_api.re.MULTILINE) for f in readmes: @@ -58,6 +61,12 @@ def _CheckThirdPartyReadmesUpdated(input_api, output_api): 'field. This field specifies whether the package is built with\n' 'Chromium. Check README.chromium.template for details.', [f])) + if not license_pattern.search(contents): + errors.append(output_api.PresubmitError( + 'Third party README files should contain a \'License\' field.\n' + 'This field specifies the license used by the package. Check\n' + 'README.chromium.template for details.', + [f])) return errors |