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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
447 disabled_warnings=['F0401', # Failed to import x | 447 disabled_warnings=['F0401', # Failed to import x |
448 'E0611', # No package y in x | 448 'E0611', # No package y in x |
449 'W0232', # Class has no __init__ method | 449 'W0232', # Class has no __init__ method |
450 ], | 450 ], |
451 pylintrc='pylintrc')) | 451 pylintrc='pylintrc')) |
452 | 452 |
453 # WebRTC can't use the presubmit_canned_checks.PanProjectChecks function since | 453 # WebRTC can't use the presubmit_canned_checks.PanProjectChecks function since |
454 # we need to have different license checks in talk/ and webrtc/ directories. | 454 # we need to have different license checks in talk/ and webrtc/ directories. |
455 # Instead, hand-picked checks are included below. | 455 # Instead, hand-picked checks are included below. |
456 | 456 |
457 # .m and .mm files are ObjC files. For simplicity we will consider .h files in | |
458 # ObjC subdirectories ObjC headers. | |
459 objc_filter_list = (r'.+\.m$', r'.+\.mm$', r'.+objc\/.+\.h$') | |
kjellander_webrtc
2016/06/06 17:01:07
While we're at it, could you add .java to the list
| |
457 # Skip long-lines check for DEPS, GN and GYP files. | 460 # Skip long-lines check for DEPS, GN and GYP files. |
458 long_lines_sources = lambda x: input_api.FilterSourceFile(x, | 461 build_file_filter_list = (r'.+\.gyp$', r'.+\.gypi$', r'.+\.gn$', r'.+\.gni$', |
459 black_list=(r'.+\.gyp$', r'.+\.gypi$', r'.+\.gn$', r'.+\.gni$', 'DEPS')) | 462 'DEPS') |
463 eighty_char_sources = lambda x: input_api.FilterSourceFile(x, | |
464 black_list=build_file_filter_list + objc_filter_list) | |
465 hundred_char_sources = lambda x: input_api.FilterSourceFile(x, | |
466 white_list=objc_filter_list) | |
460 results.extend(input_api.canned_checks.CheckLongLines( | 467 results.extend(input_api.canned_checks.CheckLongLines( |
461 input_api, output_api, maxlen=80, source_file_filter=long_lines_sources)) | 468 input_api, output_api, maxlen=80, source_file_filter=eighty_char_sources)) |
469 results.extend(input_api.canned_checks.CheckLongLines( | |
470 input_api, output_api, maxlen=100, | |
471 source_file_filter=hundred_char_sources)) | |
472 | |
462 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( | 473 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( |
463 input_api, output_api)) | 474 input_api, output_api)) |
464 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( | 475 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( |
465 input_api, output_api)) | 476 input_api, output_api)) |
466 results.extend(input_api.canned_checks.CheckChangeTodoHasOwner( | 477 results.extend(input_api.canned_checks.CheckChangeTodoHasOwner( |
467 input_api, output_api)) | 478 input_api, output_api)) |
468 results.extend(_CheckNativeApiHeaderChanges(input_api, output_api)) | 479 results.extend(_CheckNativeApiHeaderChanges(input_api, output_api)) |
469 results.extend(_CheckNoIOStreamInHeaders(input_api, output_api)) | 480 results.extend(_CheckNoIOStreamInHeaders(input_api, output_api)) |
470 results.extend(_CheckNoFRIEND_TEST(input_api, output_api)) | 481 results.extend(_CheckNoFRIEND_TEST(input_api, output_api)) |
471 results.extend(_CheckGypChanges(input_api, output_api)) | 482 results.extend(_CheckGypChanges(input_api, output_api)) |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
518 for builder in masters[master]: | 529 for builder in masters[master]: |
519 if 'presubmit' in builder: | 530 if 'presubmit' in builder: |
520 # Do not trigger presubmit builders, since they're likely to fail | 531 # Do not trigger presubmit builders, since they're likely to fail |
521 # (e.g. OWNERS checks before finished code review), and we're running | 532 # (e.g. OWNERS checks before finished code review), and we're running |
522 # local presubmit anyway. | 533 # local presubmit anyway. |
523 pass | 534 pass |
524 else: | 535 else: |
525 try_config[master][builder] = ['defaulttests'] | 536 try_config[master][builder] = ['defaulttests'] |
526 | 537 |
527 return try_config | 538 return try_config |
OLD | NEW |