From 71d4dc35090aa80cba0bfd586d52c819d68125a1 Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Wed, 23 May 2018 10:16:30 +0200 Subject: [PATCH] Add presubmit error if third_party/.git exists. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8366 Change-Id: I5fc91a18211ebbc2f6e61688bbafa7a7cc991916 Reviewed-on: https://webrtc-review.googlesource.com/78401 Commit-Queue: Artem Titov Reviewed-by: Patrik Höglund Cr-Commit-Position: refs/heads/master@{#23357} --- PRESUBMIT.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 7575948a2c..922f3cdeca 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -795,6 +795,7 @@ def CommonChecks(input_api, output_api): non_third_party_sources = lambda x: input_api.FilterSourceFile(x, black_list=third_party_filter_list) + results.extend(CheckNoGitRepoInThirdParty(input_api, output_api)) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, maxlen=80, source_file_filter=eighty_char_sources)) results.extend(input_api.canned_checks.CheckLongLines( @@ -834,6 +835,17 @@ def CommonChecks(input_api, output_api): return results +def CheckNoGitRepoInThirdParty(input_api, output_api): + if os.path.isdir(input_api.os_path.join( + input_api.PresubmitLocalPath(), 'third_party', '.git')): + return [output_api.PresubmitError("Please remove third_party/.git " + "directory. This error means that " + "possibly you also have to apply other " + "instructions from the May 11th PSA from " + "titovartem@.")] + return [] + + def CheckThirdPartyChanges(input_api, output_api): with _AddToPath(input_api.os_path.join( input_api.PresubmitLocalPath(), 'tools_webrtc', 'presubmit_checks_lib')):