Skip to content

Commit 81c7a60

Browse files
Patrik HöglundCommit Bot
Patrik Höglund
authored and
Commit Bot
committed
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}
1 parent 83245bd commit 81c7a60

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

PRESUBMIT.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,16 +529,17 @@ def CheckPublicDepsIsNotUsed(gn_files, input_api, output_api):
529529
'because it doesn\'t map well to downstream build systems.\n'
530530
'Used in: %s (line %d).\n'
531531
'If you are not adding this code (e.g. you are just moving '
532-
'existing code) or you have a good reason, you can add a '
533-
'comment on the line that causes the problem:\n\n'
532+
'existing code) or you have a good reason, you can add this '
533+
'comment (verbatim) on the line that causes the problem:\n\n'
534534
'public_deps = [ # no-presubmit-check TODO(webrtc:8603)\n')
535535
for affected_file in gn_files:
536536
for (line_number, affected_line) in affected_file.ChangedContents():
537-
if ('public_deps' in affected_line
538-
and not no_presubmit_check_re.search(affected_line)):
539-
result.append(
540-
output_api.PresubmitError(error_msg % (affected_file.LocalPath(),
541-
line_number)))
537+
if 'public_deps' in affected_line:
538+
surpressed = no_presubmit_check_re.search(affected_line)
539+
if not surpressed:
540+
result.append(
541+
output_api.PresubmitError(error_msg % (affected_file.LocalPath(),
542+
line_number)))
542543
return result
543544

544545

test/BUILD.gn

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ rtc_source_set("test_support") {
297297

298298
public_deps = [] # no-presubmit-check TODO(webrtc:8603)
299299
if (is_ios) {
300-
public_deps += [ ":test_support_objc" ] # no-presubmit-check TODO(webrtc:8603)
300+
public_deps += # no-presubmit-check TODO(webrtc:8603)
301+
[ ":test_support_objc" ]
301302
}
302303

303304
public_configs = [ ":test_main_direct_config" ]
@@ -620,7 +621,8 @@ rtc_source_set("run_test") {
620621
if (is_mac) {
621622
public_deps = [ ":run_test_objc" ] # no-presubmit-check TODO(webrtc:8603)
622623
} else {
623-
public_deps = [ ":run_test_generic" ] # no-presubmit-check TODO(webrtc:8603)
624+
public_deps = # no-presubmit-check TODO(webrtc:8603)
625+
[ ":run_test_generic" ]
624626
}
625627
}
626628

@@ -677,7 +679,8 @@ rtc_library("direct_transport") {
677679
"../rtc_base/task_utils:repeating_task",
678680
"//third_party/abseil-cpp/absl/memory",
679681
]
680-
public_deps = [ "../call:fake_network" ] # no-presubmit-check TODO(webrtc:8603)
682+
public_deps = # no-presubmit-check TODO(webrtc:8603)
683+
[ "../call:fake_network" ]
681684
}
682685

683686
rtc_library("fake_video_codecs") {
@@ -832,10 +835,12 @@ rtc_library("test_common") {
832835
}
833836

834837
rtc_source_set("test_renderer") {
835-
public_deps = [ ":test_renderer_generic" ] # no-presubmit-check TODO(webrtc:8603)
838+
public_deps = # no-presubmit-check TODO(webrtc:8603)
839+
[ ":test_renderer_generic" ]
836840
testonly = true
837841
if (is_mac) {
838-
public_deps += [ ":test_renderer_objc" ] # no-presubmit-check TODO(webrtc:8603)
842+
public_deps += # no-presubmit-check TODO(webrtc:8603)
843+
[ ":test_renderer_objc" ]
839844
}
840845
}
841846

0 commit comments

Comments
 (0)