Fix public_deps presubmit and gn format fighting each other.

I changed stuff in test/BUILD.gn, but the suggested formatting broke
the presubmit. I tried rewriting the presubmit so it checks the
previous line as well, but that turned out to be hard.

Please try to enable this presubmit on ALL lines in a changed file.
Presubmits that only work on changed lines are really confusing.

Bug: None
Change-Id: I2386c765367681f683d82739293bc8bc8a873a7b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167926
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30420}
This commit is contained in:
Patrik Höglund 2020-01-30 11:32:33 +01:00 committed by Commit Bot
parent 83245bde3d
commit 81c7a60961
2 changed files with 18 additions and 12 deletions

View file

@ -529,13 +529,14 @@ def CheckPublicDepsIsNotUsed(gn_files, input_api, output_api):
'because it doesn\'t map well to downstream build systems.\n'
'Used in: %s (line %d).\n'
'If you are not adding this code (e.g. you are just moving '
'existing code) or you have a good reason, you can add a '
'comment on the line that causes the problem:\n\n'
'existing code) or you have a good reason, you can add this '
'comment (verbatim) on the line that causes the problem:\n\n'
'public_deps = [ # no-presubmit-check TODO(webrtc:8603)\n')
for affected_file in gn_files:
for (line_number, affected_line) in affected_file.ChangedContents():
if ('public_deps' in affected_line
and not no_presubmit_check_re.search(affected_line)):
if 'public_deps' in affected_line:
surpressed = no_presubmit_check_re.search(affected_line)
if not surpressed:
result.append(
output_api.PresubmitError(error_msg % (affected_file.LocalPath(),
line_number)))

View file

@ -297,7 +297,8 @@ rtc_source_set("test_support") {
public_deps = [] # no-presubmit-check TODO(webrtc:8603)
if (is_ios) {
public_deps += [ ":test_support_objc" ] # no-presubmit-check TODO(webrtc:8603)
public_deps += # no-presubmit-check TODO(webrtc:8603)
[ ":test_support_objc" ]
}
public_configs = [ ":test_main_direct_config" ]
@ -620,7 +621,8 @@ rtc_source_set("run_test") {
if (is_mac) {
public_deps = [ ":run_test_objc" ] # no-presubmit-check TODO(webrtc:8603)
} else {
public_deps = [ ":run_test_generic" ] # no-presubmit-check TODO(webrtc:8603)
public_deps = # no-presubmit-check TODO(webrtc:8603)
[ ":run_test_generic" ]
}
}
@ -677,7 +679,8 @@ rtc_library("direct_transport") {
"../rtc_base/task_utils:repeating_task",
"//third_party/abseil-cpp/absl/memory",
]
public_deps = [ "../call:fake_network" ] # no-presubmit-check TODO(webrtc:8603)
public_deps = # no-presubmit-check TODO(webrtc:8603)
[ "../call:fake_network" ]
}
rtc_library("fake_video_codecs") {
@ -832,10 +835,12 @@ rtc_library("test_common") {
}
rtc_source_set("test_renderer") {
public_deps = [ ":test_renderer_generic" ] # no-presubmit-check TODO(webrtc:8603)
public_deps = # no-presubmit-check TODO(webrtc:8603)
[ ":test_renderer_generic" ]
testonly = true
if (is_mac) {
public_deps += [ ":test_renderer_objc" ] # no-presubmit-check TODO(webrtc:8603)
public_deps += # no-presubmit-check TODO(webrtc:8603)
[ ":test_renderer_objc" ]
}
}