From 255d982498a66be49333a2f9d7d5622e6818c10f Mon Sep 17 00:00:00 2001 From: AnimeGitB Date: Tue, 12 Jul 2022 11:41:34 +0930 Subject: [PATCH] Make whitespace formatter only target 8e3deb9 --- format_whitespace.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/format_whitespace.py b/format_whitespace.py index 7e4844d72..2221da716 100644 --- a/format_whitespace.py +++ b/format_whitespace.py @@ -16,14 +16,16 @@ re_keyword_space = re.compile(r'(?<=\b)(if|for|while|switch|try|else|catch|final def get_changed_filelist(): - subprocess.run(['git', 'fetch', UPSTREAM, f'{RATCHET}:{RATCHET}']) # Ensure LintRatchet ref is matched to upstream - result = subprocess.run(['git', 'diff', RATCHET, '--name-only'], capture_output=True, text=True) + # subprocess.run(['git', 'fetch', UPSTREAM, f'{RATCHET}:{RATCHET}']) # Ensure LintRatchet ref is matched to upstream + # result = subprocess.run(['git', 'diff', RATCHET, '--name-only'], capture_output=True, text=True) + # if result.returncode != 0: + # print(f'{RATCHET} not found, trying fallback {RATCHET_FALLBACK}') + print(f'Attempting to diff against {RATCHET_FALLBACK}') + result = subprocess.run(['git', 'diff', RATCHET_FALLBACK, '--name-only'], capture_output=True, text=True) if result.returncode != 0: - print(f'{RATCHET} not found, trying fallback {RATCHET_FALLBACK}') - result = subprocess.run(['git', 'diff', RATCHET_FALLBACK, '--name-only'], capture_output=True, text=True) - if result.returncode != 0: - print('Fallback is also missing, aborting.') - exit(1) + # print('Fallback is also missing, aborting.') + print(f'Could not find {RATCHET_FALLBACK}, aborting.') + exit(1) return result.stdout.strip().split('\n')