diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-10 16:19:40 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-10 16:01:50 +0000 |
commit | 51f6c2793adab2d864b3d2b360000ef8db1d3e92 (patch) | |
tree | 835b3b4446b012c75e80177cef9fbe6972cc7dbe /chromium/PRESUBMIT.py | |
parent | 6036726eb981b6c4b42047513b9d3f4ac865daac (diff) | |
download | qtwebengine-chromium-51f6c2793adab2d864b3d2b360000ef8db1d3e92.tar.gz |
BASELINE: Update Chromium to 71.0.3578.93
Change-Id: I6a32086c33670e1b033f8b10e6bf1fd4da1d105d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/PRESUBMIT.py')
-rw-r--r-- | chromium/PRESUBMIT.py | 278 |
1 files changed, 163 insertions, 115 deletions
diff --git a/chromium/PRESUBMIT.py b/chromium/PRESUBMIT.py index e6fd3085fba..2391c99652e 100644 --- a/chromium/PRESUBMIT.py +++ b/chromium/PRESUBMIT.py @@ -10,24 +10,24 @@ for more details about the presubmit API built into depot_tools. _EXCLUDED_PATHS = ( - r"^native_client_sdk[\\\/]src[\\\/]build_tools[\\\/]make_rules.py", - r"^native_client_sdk[\\\/]src[\\\/]build_tools[\\\/]make_simple.py", - r"^native_client_sdk[\\\/]src[\\\/]tools[\\\/].*.mk", - r"^net[\\\/]tools[\\\/]spdyshark[\\\/].*", - r"^skia[\\\/].*", - r"^third_party[\\\/](WebKit|blink)[\\\/].*", - r"^third_party[\\\/]breakpad[\\\/].*", - r"^v8[\\\/].*", + r"^native_client_sdk[\\/]src[\\/]build_tools[\\/]make_rules.py", + r"^native_client_sdk[\\/]src[\\/]build_tools[\\/]make_simple.py", + r"^native_client_sdk[\\/]src[\\/]tools[\\/].*.mk", + r"^net[\\/]tools[\\/]spdyshark[\\/].*", + r"^skia[\\/].*", + r"^third_party[\\/](WebKit|blink)[\\/].*", + r"^third_party[\\/]breakpad[\\/].*", + r"^v8[\\/].*", r".*MakeFile$", r".+_autogen\.h$", - r".+[\\\/]pnacl_shim\.c$", - r"^gpu[\\\/]config[\\\/].*_list_json\.cc$", - r"^chrome[\\\/]browser[\\\/]resources[\\\/]pdf[\\\/]index.js", - r"tools[\\\/]md_browser[\\\/].*\.css$", + r".+[\\/]pnacl_shim\.c$", + r"^gpu[\\/]config[\\/].*_list_json\.cc$", + r"^chrome[\\/]browser[\\/]resources[\\/]pdf[\\/]index.js", + r"tools[\\/]md_browser[\\/].*\.css$", # Test pages for Maps telemetry tests. - r"tools[\\\/]perf[\\\/]page_sets[\\\/]maps_perf_test.*", + r"tools[\\/]perf[\\/]page_sets[\\/]maps_perf_test.*", # Test pages for WebRTC telemetry tests. - r"tools[\\\/]perf[\\\/]page_sets[\\\/]webrtc_cases.*", + r"tools[\\/]perf[\\/]page_sets[\\/]webrtc_cases.*", ) @@ -44,18 +44,18 @@ _HEADER_EXTENSIONS = r'\.(h|hpp|hxx)$' # Regular expression that matches code only used for test binaries # (best effort). _TEST_CODE_EXCLUDED_PATHS = ( - r'.*[\\\/](fake_|test_|mock_).+%s' % _IMPLEMENTATION_EXTENSIONS, + r'.*[\\/](fake_|test_|mock_).+%s' % _IMPLEMENTATION_EXTENSIONS, r'.+_test_(base|support|util)%s' % _IMPLEMENTATION_EXTENSIONS, r'.+_(api|browser|eg|int|perf|pixel|unit|ui)?test(_[a-z]+)?%s' % _IMPLEMENTATION_EXTENSIONS, r'.+profile_sync_service_harness%s' % _IMPLEMENTATION_EXTENSIONS, - r'.*[\\\/](test|tool(s)?)[\\\/].*', + r'.*[\\/](test|tool(s)?)[\\/].*', # content_shell is used for running layout tests. - r'content[\\\/]shell[\\\/].*', + r'content[\\/]shell[\\/].*', # Non-production example code. - r'mojo[\\\/]examples[\\\/].*', + r'mojo[\\/]examples[\\/].*', # Launcher for running iOS tests on the simulator. - r'testing[\\\/]iossim[\\\/]iossim\.mm$', + r'testing[\\/]iossim[\\/]iossim\.mm$', ) @@ -238,9 +238,9 @@ _BANNED_CPP_FUNCTIONS = ( ), True, ( - r"^ui[\\\/]gl[\\\/].*\.cc$", - r"^media[\\\/]gpu[\\\/].*\.cc$", - r"^gpu[\\\/].*\.cc$", + r"^ui[\\/]gl[\\/].*\.cc$", + r"^media[\\/]gpu[\\/].*\.cc$", + r"^gpu[\\/].*\.cc$", ), ), ( @@ -250,9 +250,9 @@ _BANNED_CPP_FUNCTIONS = ( ), True, ( - r"^gpu[\\\/]ipc[\\\/]service[\\\/]gpu_watchdog_thread\.cc$", - r"^remoting[\\\/]host[\\\/]linux[\\\/]x_server_clipboard\.cc$", - r"^ui[\\\/]gfx[\\\/]x[\\\/]x11_atom_cache\.cc$", + r"^gpu[\\/]ipc[\\/]service[\\/]gpu_watchdog_thread\.cc$", + r"^remoting[\\/]host[\\/]linux[\\/]x_server_clipboard\.cc$", + r"^ui[\\/]gfx[\\/]x[\\/]x11_atom_cache\.cc$", ), ), ( @@ -321,8 +321,8 @@ _BANNED_CPP_FUNCTIONS = ( True, ( # Files that #define IGNORE_EINTR. - r'^base[\\\/]posix[\\\/]eintr_wrapper\.h$', - r'^ppapi[\\\/]tests[\\\/]test_broker\.cc$', + r'^base[\\/]posix[\\/]eintr_wrapper\.h$', + r'^ppapi[\\/]tests[\\/]test_broker\.cc$', ), ), ( @@ -333,7 +333,7 @@ _BANNED_CPP_FUNCTIONS = ( ), True, ( - r'extensions[\\\/]renderer[\\\/]safe_builtins\.*', + r'extensions[\\/]renderer[\\/]safe_builtins\.*', ), ), ( @@ -343,7 +343,7 @@ _BANNED_CPP_FUNCTIONS = ( ), True, ( - r'^third_party[\\\/]abseil-cpp[\\\/].*', + r'^third_party[\\/]abseil-cpp[\\/].*', ), ), ( @@ -386,9 +386,9 @@ _BANNED_CPP_FUNCTIONS = ( ), False, ( - r'^content[\\\/]browser[\\\/]webui[\\\/]web_ui_impl\.(cc|h)$', - r'^content[\\\/]public[\\\/]browser[\\\/]web_ui\.h$', - r'^content[\\\/]public[\\\/]test[\\\/]test_web_ui\.(cc|h)$', + r'^content[\\/]browser[\\/]webui[\\/]web_ui_impl\.(cc|h)$', + r'^content[\\/]public[\\/]browser[\\/]web_ui\.h$', + r'^content[\\/]public[\\/]test[\\/]test_web_ui\.(cc|h)$', ), ), ( @@ -557,11 +557,11 @@ _BANNED_CPP_FUNCTIONS = ( ), False, ( - r'^ios[\\\/].*\.(cc|h)$', - r'.*[\\\/]ios[\\\/].*\.(cc|h)$', + r'^ios[\\/].*\.(cc|h)$', + r'.*[\\/]ios[\\/].*\.(cc|h)$', r'.*_ios\.(cc|h)$', - r'^net[\\\/].*\.(cc|h)$', - r'.*[\\\/]tools[\\\/].*\.(cc|h)$', + r'^net[\\/].*\.(cc|h)$', + r'.*[\\/]tools[\\/].*\.(cc|h)$', ), ), ( @@ -582,6 +582,14 @@ _BANNED_CPP_FUNCTIONS = ( True, (), ), + ( + 'ios/web/public/test/http_server', + ( + 'web::HTTPserver is deprecated use net::EmbeddedTestServer instead.', + ), + False, + (), + ), ) @@ -597,18 +605,19 @@ _LONG_PATH_ERROR = ( ) _JAVA_MULTIPLE_DEFINITION_EXCLUDED_PATHS = [ - r".*[\\\/]BuildHooksAndroidImpl\.java", - r".*[\\\/]LicenseContentProvider\.java", - r".*[\\\/]PlatformServiceBridgeImpl.java", + r".*[\\/]BuildHooksAndroidImpl\.java", + r".*[\\/]LicenseContentProvider\.java", + r".*[\\/]PlatformServiceBridgeImpl.java", + r".*chrome[\\\/]android[\\\/]feed[\\\/]dummy[\\\/].*\.java", ] # These paths contain test data and other known invalid JSON files. _KNOWN_INVALID_JSON_FILE_PATTERNS = [ - r'test[\\\/]data[\\\/]', - r'^components[\\\/]policy[\\\/]resources[\\\/]policy_templates\.json$', - r'^third_party[\\\/]protobuf[\\\/]', - r'^third_party[\\\/]WebKit[\\\/]LayoutTests[\\\/]external[\\\/]wpt[\\\/]', - r'^third_party[\\\/]blink[\\\/]renderer[\\\/]devtools[\\\/]protocol\.json$', + r'test[\\/]data[\\/]', + r'^components[\\/]policy[\\/]resources[\\/]policy_templates\.json$', + r'^third_party[\\/]protobuf[\\/]', + r'^third_party[\\/]WebKit[\\/]LayoutTests[\\/]external[\\/]wpt[\\/]', + r'^third_party[\\/]blink[\\/]renderer[\\/]devtools[\\/]protocol\.json$', ] @@ -638,6 +647,7 @@ _VALID_OS_MACROS = ( _ANDROID_SPECIFIC_PYDEPS_FILES = [ + 'android_webview/tools/run_cts.pydeps', 'base/android/jni_generator/jni_generator.pydeps', 'base/android/jni_generator/jni_registration_generator.pydeps', 'build/android/gyp/aar.pydeps', @@ -705,7 +715,11 @@ _KNOWN_ROBOTS = set( ) | set('%s@appspot.gserviceaccount.com' % s for s in ('findit-for-me',) ) | set('%s@developer.gserviceaccount.com' % s for s in ('3su6n15k.default',) ) | set('%s@chops-service-accounts.iam.gserviceaccount.com' % s - for s in ('v8-ci-autoroll-builder',)) + for s in ('v8-ci-autoroll-builder',) + ) | set('%s@skia-public.iam.gserviceaccount.com' % s + for s in ('chromium-autoroll',) + ) | set('%s@skia-corp.google.com.iam.gserviceaccount.com' % s + for s in ('chromium-internal-autoroll',)) def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): @@ -853,6 +867,59 @@ def _CheckNoUNIT_TESTInSourceFiles(input_api, output_api): return [output_api.PresubmitPromptWarning('UNIT_TEST is only for headers.\n' + '\n'.join(problems))] +def _CheckNoDISABLETypoInTests(input_api, output_api): + """Checks to prevent attempts to disable tests with DISABLE_ prefix. + + This test warns if somebody tries to disable a test with the DISABLE_ prefix + instead of DISABLED_. To filter false positives, reports are only generated + if a corresponding MAYBE_ line exists. + """ + problems = [] + + # The following two patterns are looked for in tandem - is a test labeled + # as MAYBE_ followed by a DISABLE_ (instead of the correct DISABLED) + maybe_pattern = input_api.re.compile(r'MAYBE_([a-zA-Z0-9_]+)') + disable_pattern = input_api.re.compile(r'DISABLE_([a-zA-Z0-9_]+)') + + # This is for the case that a test is disabled on all platforms. + full_disable_pattern = input_api.re.compile( + r'^\s*TEST[^(]*\([a-zA-Z0-9_]+,\s*DISABLE_[a-zA-Z0-9_]+\)', + input_api.re.MULTILINE) + + for f in input_api.AffectedFiles(False): + if not 'test' in f.LocalPath() or not f.LocalPath().endswith('.cc'): + continue + + # Search for MABYE_, DISABLE_ pairs. + disable_lines = {} # Maps of test name to line number. + maybe_lines = {} + for line_num, line in f.ChangedContents(): + disable_match = disable_pattern.search(line) + if disable_match: + disable_lines[disable_match.group(1)] = line_num + maybe_match = maybe_pattern.search(line) + if maybe_match: + maybe_lines[maybe_match.group(1)] = line_num + + # Search for DISABLE_ occurrences within a TEST() macro. + disable_tests = set(disable_lines.keys()) + maybe_tests = set(maybe_lines.keys()) + for test in disable_tests.intersection(maybe_tests): + problems.append(' %s:%d' % (f.LocalPath(), disable_lines[test])) + + contents = input_api.ReadFile(f) + full_disable_match = full_disable_pattern.search(contents) + if full_disable_match: + problems.append(' %s' % f.LocalPath()) + + if not problems: + return [] + return [ + output_api.PresubmitPromptWarning( + 'Attempt to disable a test with DISABLE_ instead of DISABLED_?\n' + + '\n'.join(problems)) + ] + def _CheckDCHECK_IS_ONHasBraces(input_api, output_api): """Checks to make sure DCHECK_IS_ON() does not skip the parentheses.""" @@ -1354,7 +1421,7 @@ def _CheckHardcodedGoogleHostsInLowerLayers(input_api, output_api): """ return input_api.FilterSourceFile( affected_file, - white_list=[r'^(android_webview|base|content|net)[\\\/].*'], + white_list=[r'^(android_webview|base|content|net)[\\/].*'], black_list=(_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST)) @@ -1387,7 +1454,7 @@ def _CheckNoAbbreviationInPngFileName(input_api, output_api): """ errors = [] white_list = [r'.*_[a-z]_.*\.png$|.*_[a-z]\.png$'] - black_list = [r'^native_client_sdk[\\\/]'] + black_list = [r'^native_client_sdk[\\/]'] file_filter = lambda f: input_api.FilterSourceFile( f, white_list=white_list, black_list=black_list) for f in input_api.AffectedFiles(include_deletes=False, @@ -1482,7 +1549,7 @@ def _CheckAddedDepsHaveTargetApprovals(input_api, output_api): virtual_depended_on_files = set() file_filter = lambda f: not input_api.re.match( - r"^third_party[\\\/](WebKit|blink)[\\\/].*", f.LocalPath()) + r"^third_party[\\/](WebKit|blink)[\\/].*", f.LocalPath()) for f in input_api.AffectedFiles(include_deletes=False, file_filter=file_filter): filename = input_api.os_path.basename(f.LocalPath()) @@ -1557,44 +1624,44 @@ def _CheckSpamLogging(input_api, output_api): black_list = (_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST + - (r"^base[\\\/]logging\.h$", - r"^base[\\\/]logging\.cc$", - r"^chrome[\\\/]app[\\\/]chrome_main_delegate\.cc$", - r"^chrome[\\\/]browser[\\\/]chrome_browser_main\.cc$", - r"^chrome[\\\/]browser[\\\/]ui[\\\/]startup[\\\/]" + (r"^base[\\/]logging\.h$", + r"^base[\\/]logging\.cc$", + r"^chrome[\\/]app[\\/]chrome_main_delegate\.cc$", + r"^chrome[\\/]browser[\\/]chrome_browser_main\.cc$", + r"^chrome[\\/]browser[\\/]ui[\\/]startup[\\/]" r"startup_browser_creator\.cc$", - r"^chrome[\\\/]installer[\\\/]setup[\\\/].*", - r"^chrome[\\\/]chrome_cleaner[\\\/].*", - r"chrome[\\\/]browser[\\\/]diagnostics[\\\/]" + + r"^chrome[\\/]installer[\\/]setup[\\/].*", + r"^chrome[\\/]chrome_cleaner[\\/].*", + r"chrome[\\/]browser[\\/]diagnostics[\\/]" + r"diagnostics_writer\.cc$", - r"^chrome_elf[\\\/]dll_hash[\\\/]dll_hash_main\.cc$", - r"^chromecast[\\\/]", - r"^cloud_print[\\\/]", - r"^components[\\\/]browser_watcher[\\\/]" + r"^chrome_elf[\\/]dll_hash[\\/]dll_hash_main\.cc$", + r"^chromecast[\\/]", + r"^cloud_print[\\/]", + r"^components[\\/]browser_watcher[\\/]" r"dump_stability_report_main_win.cc$", - r"^components[\\\/]html_viewer[\\\/]" + r"^components[\\/]html_viewer[\\/]" r"web_test_delegate_impl\.cc$", - r"^components[\\\/]zucchini[\\\/].*", + r"^components[\\/]zucchini[\\/].*", # TODO(peter): Remove this exception. https://crbug.com/534537 - r"^content[\\\/]browser[\\\/]notifications[\\\/]" + r"^content[\\/]browser[\\/]notifications[\\/]" r"notification_event_dispatcher_impl\.cc$", - r"^content[\\\/]common[\\\/]gpu[\\\/]client[\\\/]" + r"^content[\\/]common[\\/]gpu[\\/]client[\\/]" r"gl_helper_benchmark\.cc$", - r"^courgette[\\\/]courgette_minimal_tool\.cc$", - r"^courgette[\\\/]courgette_tool\.cc$", - r"^extensions[\\\/]renderer[\\\/]logging_native_handler\.cc$", - r"^ipc[\\\/]ipc_logging\.cc$", - r"^native_client_sdk[\\\/]", - r"^remoting[\\\/]base[\\\/]logging\.h$", - r"^remoting[\\\/]host[\\\/].*", - r"^sandbox[\\\/]linux[\\\/].*", - r"^tools[\\\/]", - r"^ui[\\\/]base[\\\/]resource[\\\/]data_pack.cc$", - r"^ui[\\\/]aura[\\\/]bench[\\\/]bench_main\.cc$", - r"^ui[\\\/]ozone[\\\/]platform[\\\/]cast[\\\/]", - r"^storage[\\\/]browser[\\\/]fileapi[\\\/]" + + r"^courgette[\\/]courgette_minimal_tool\.cc$", + r"^courgette[\\/]courgette_tool\.cc$", + r"^extensions[\\/]renderer[\\/]logging_native_handler\.cc$", + r"^ipc[\\/]ipc_logging\.cc$", + r"^native_client_sdk[\\/]", + r"^remoting[\\/]base[\\/]logging\.h$", + r"^remoting[\\/]host[\\/].*", + r"^sandbox[\\/]linux[\\/].*", + r"^tools[\\/]", + r"^ui[\\/]base[\\/]resource[\\/]data_pack.cc$", + r"^ui[\\/]aura[\\/]bench[\\/]bench_main\.cc$", + r"^ui[\\/]ozone[\\/]platform[\\/]cast[\\/]", + r"^storage[\\/]browser[\\/]fileapi[\\/]" + r"dump_file_system.cc$", - r"^headless[\\\/]app[\\\/]headless_shell\.cc$")) + r"^headless[\\/]app[\\/]headless_shell\.cc$")) source_file_filter = lambda x: input_api.FilterSourceFile( x, white_list=file_inclusion_pattern, black_list=black_list) @@ -1858,12 +1925,12 @@ def _CheckParseErrors(input_api, output_api): } # Most JSON files are preprocessed and support comments, but these do not. json_no_comments_patterns = [ - r'^testing[\\\/]', + r'^testing[\\/]', ] # Only run IDL checker on files in these directories. idl_included_patterns = [ - r'^chrome[\\\/]common[\\\/]extensions[\\\/]api[\\\/]', - r'^extensions[\\\/]common[\\\/]api[\\\/]', + r'^chrome[\\/]common[\\/]extensions[\\/]api[\\/]', + r'^extensions[\\/]common[\\/]api[\\/]', ] def get_action(affected_file): @@ -2159,8 +2226,8 @@ def _CheckAndroidToastUsage(input_api, output_api): black_list=(_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST + - (r'^chromecast[\\\/].*', - r'^remoting[\\\/].*')), + (r'^chromecast[\\/].*', + r'^remoting[\\/].*')), white_list=[r'.*\.java$']) for f in input_api.AffectedSourceFiles(sources): @@ -2190,10 +2257,13 @@ def _CheckAndroidCrLogUsage(input_api, output_api): # Do not check format of logs in the given files cr_log_check_excluded_paths = [ # //chrome/android/webapk cannot depend on //base - r"^chrome[\\\/]android[\\\/]webapk[\\\/].*", + r"^chrome[\\/]android[\\/]webapk[\\/].*", # WebView license viewer code cannot depend on //base; used in stub APK. - r"^android_webview[\\\/]glue[\\\/]java[\\\/]src[\\\/]com[\\\/]android[\\\/]" - r"webview[\\\/]chromium[\\\/]License.*", + r"^android_webview[\\/]glue[\\/]java[\\/]src[\\/]com[\\/]android[\\/]" + r"webview[\\/]chromium[\\/]License.*", + # The customtabs_benchmark is a small app that does not depend on Chromium + # java pieces. + r"tools[\\/]android[\\/]customtabs_benchmark[\\/].*", ] cr_log_import_pattern = input_api.re.compile( @@ -2398,7 +2468,7 @@ def _CheckAndroidWebkitImports(input_api, output_api): black_list=(_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST + - (r'^android_webview[\\\/]glue[\\\/].*',)), + (r'^android_webview[\\/]glue[\\/].*',)), white_list=[r'.*\.java$']) for f in input_api.AffectedSourceFiles(sources): @@ -2539,8 +2609,8 @@ def _CheckSingletonInHeaders(input_api, output_api): # It's ok for base/memory/singleton.h to have |Singleton<|. black_list = (_EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST + - (r"^base[\\\/]memory[\\\/]singleton\.h$", - r"^net[\\\/]quic[\\\/]platform[\\\/]impl[\\\/]" + (r"^base[\\/]memory[\\/]singleton\.h$", + r"^net[\\/]quic[\\/]platform[\\/]impl[\\/]" r"quic_singleton_impl\.h$")) return input_api.FilterSourceFile(affected_file, black_list=black_list) @@ -2688,7 +2758,7 @@ def _CheckForRiskyJsFeatures(input_api, output_api): Use of => (arrow) operator detected in: %s Please ensure your code does not run on iOS9 (=> (arrow) does not work there). -https://chromium.googlesource.com/chromium/src/+/master/docs/es6_chromium.md#Arrow-Functions +https://chromium.googlesource.com/chromium/src/+/master/styleguide/web/es6.md#Arrow-Functions """ % f.LocalPath() ]))) @@ -2702,8 +2772,8 @@ Use of const/let keywords detected in: %s Please ensure your code does not run on iOS9 because const/let is not fully supported. -https://chromium.googlesource.com/chromium/src/+/master/docs/es6_chromium.md#let-Block_Scoped-Variables -https://chromium.googlesource.com/chromium/src/+/master/docs/es6_chromium.md#const-Block_Scoped-Constants +https://chromium.googlesource.com/chromium/src/+/master/styleguide/web/es6.md#let-Block_Scoped-Variables +https://chromium.googlesource.com/chromium/src/+/master/styleguide/web/es6.md#const-Block_Scoped-Constants """ % f.LocalPath() ]))) @@ -2952,6 +3022,7 @@ def _CommonChecks(input_api, output_api): _CheckNoProductionCodeUsingTestOnlyFunctionsJava(input_api, output_api)) results.extend(_CheckNoIOStreamInHeaders(input_api, output_api)) results.extend(_CheckNoUNIT_TESTInSourceFiles(input_api, output_api)) + results.extend(_CheckNoDISABLETypoInTests(input_api, output_api)) results.extend(_CheckDCHECK_IS_ONHasBraces(input_api, output_api)) results.extend(_CheckNoNewWStrings(input_api, output_api)) results.extend(_CheckNoDEPSGIT(input_api, output_api)) @@ -3366,28 +3437,6 @@ def _CheckSyslogUseWarning(input_api, output_api, source_file_filter=None): return [] -def _CheckCrbugLinksHaveHttps(input_api, output_api): - """Checks that crbug(.com) links are correctly prefixed by https://, - unless they come in the accepted form TODO(crbug.com/...) - """ - - # The cr bug strings are split to avoid matching in real presubmit - # checkings. - pattern = input_api.re.compile(r'//.*(?<!:\/\/)cr''bug[.com]*') - accepted_pattern = input_api.re.compile(r'//.*TODO\(cr''bug[.com]*') - problems = [] - for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): - for line_num, line in f.ChangedContents(): - if pattern.search(line) and not accepted_pattern.search(line): - problems.append(' %s:%d %s' % (f.LocalPath(), line_num, line)) - - if problems: - return [output_api.PresubmitPromptWarning( - 'Found unprefixed crbug.com URL(s), consider prepending https://\n' + - '\n'.join(problems))] - return [] - - def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) @@ -3398,7 +3447,6 @@ def CheckChangeOnUpload(input_api, output_api): results.extend(_AndroidSpecificOnUploadChecks(input_api, output_api)) results.extend(_CheckSyslogUseWarning(input_api, output_api)) results.extend(_CheckGoogleSupportAnswerUrl(input_api, output_api)) - results.extend(_CheckCrbugLinksHaveHttps(input_api, output_api)) results.extend(_CheckUniquePtr(input_api, output_api)) results.extend(_CheckNewHeaderWithoutGnChange(input_api, output_api)) return results |