From 04afb4b256a1aab562b0fcfaf7cd9ffe4ec42c1b Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Fri, 26 May 2023 22:32:23 +0000 Subject: [PATCH] Skip owners file format check on skip_owners CheckOwnersFormat requires network and code owners plugin to be enabled. This moves that check under condition. R=jojwang@google.com Change-Id: Ic9cfd5e33987cac9aae93d744ebfb2482eb309be Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4571106 Auto-Submit: Josip Sokcevic Commit-Queue: Joanna Wang Reviewed-by: Joanna Wang Commit-Queue: Josip Sokcevic --- presubmit_canned_checks.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index daef217e2..045f71475 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -1467,16 +1467,14 @@ def PanProjectChecks(input_api, output_api, snapshot("checking owners files format") try: - if not 'PRESUBMIT_SKIP_NETWORK' in _os.environ: + if not 'PRESUBMIT_SKIP_NETWORK' in _os.environ and owners_check: + snapshot("checking owners") results.extend( input_api.canned_checks.CheckOwnersFormat(input_api, output_api)) - - if owners_check: - snapshot("checking owners") - results.extend( - input_api.canned_checks.CheckOwners(input_api, - output_api, - source_file_filter=None)) + results.extend( + input_api.canned_checks.CheckOwners(input_api, + output_api, + source_file_filter=None)) except Exception as e: print('Failed to check owners - %s' % str(e))