OLD | NEW |
1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import json | 9 import json |
10 import os | 10 import os |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 added_includes): | 391 added_includes): |
392 description_with_path = '%s\n %s' % (path, rule_description) | 392 description_with_path = '%s\n %s' % (path, rule_description) |
393 if rule_type == Rule.DISALLOW: | 393 if rule_type == Rule.DISALLOW: |
394 error_descriptions.append(description_with_path) | 394 error_descriptions.append(description_with_path) |
395 else: | 395 else: |
396 warning_descriptions.append(description_with_path) | 396 warning_descriptions.append(description_with_path) |
397 | 397 |
398 results = [] | 398 results = [] |
399 if error_descriptions: | 399 if error_descriptions: |
400 results.append(output_api.PresubmitError( | 400 results.append(output_api.PresubmitError( |
401 'You added one or more #includes that violate checkdeps rules.', | 401 'You added one or more #includes that violate checkdeps rules.\n' |
| 402 'Check that the DEPS files in these locations contain valid rules.\n' |
| 403 'See https://cs.chromium.org/chromium/src/buildtools/checkdeps/ for ' |
| 404 'more details about checkdeps.', |
402 error_descriptions)) | 405 error_descriptions)) |
403 if warning_descriptions: | 406 if warning_descriptions: |
404 results.append(output_api.PresubmitPromptOrNotify( | 407 results.append(output_api.PresubmitPromptOrNotify( |
405 'You added one or more #includes of files that are temporarily\n' | 408 'You added one or more #includes of files that are temporarily\n' |
406 'allowed but being removed. Can you avoid introducing the\n' | 409 'allowed but being removed. Can you avoid introducing the\n' |
407 '#include? See relevant DEPS file(s) for details and contacts.', | 410 '#include? See relevant DEPS file(s) for details and contacts.\n' |
| 411 'See https://cs.chromium.org/chromium/src/buildtools/checkdeps/ for ' |
| 412 'more details about checkdeps.', |
408 warning_descriptions)) | 413 warning_descriptions)) |
409 return results | 414 return results |
410 | 415 |
411 def _CheckChangeHasBugField(input_api, output_api): | 416 def _CheckChangeHasBugField(input_api, output_api): |
412 """Requires that the changelist have a BUG= field. | 417 """Requires that the changelist have a BUG= field. |
413 | 418 |
414 This check is stricter than the one in depot_tools/presubmit_canned_checks.py | 419 This check is stricter than the one in depot_tools/presubmit_canned_checks.py |
415 since it fails the presubmit if the BUG= field is missing or doesn't contain | 420 since it fails the presubmit if the BUG= field is missing or doesn't contain |
416 a bug reference. | 421 a bug reference. |
417 """ | 422 """ |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 input_api, output_api)) | 564 input_api, output_api)) |
560 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 565 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
561 input_api, output_api)) | 566 input_api, output_api)) |
562 results.extend(_CheckChangeHasBugField(input_api, output_api)) | 567 results.extend(_CheckChangeHasBugField(input_api, output_api)) |
563 results.extend(input_api.canned_checks.CheckChangeHasTestField( | 568 results.extend(input_api.canned_checks.CheckChangeHasTestField( |
564 input_api, output_api)) | 569 input_api, output_api)) |
565 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 570 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
566 input_api, output_api, | 571 input_api, output_api, |
567 json_url='http://webrtc-status.appspot.com/current?format=json')) | 572 json_url='http://webrtc-status.appspot.com/current?format=json')) |
568 return results | 573 return results |
OLD | NEW |