From d859271d5d7c8b9f105a2163a8272f9072aa50b6 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Sun, 27 Mar 2016 20:43:02 +0000 Subject: [PATCH] add scrubber for excessive leading whitespace llvm-svn: 264542 --- llvm/utils/update_test_checks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py index f43d12c..e36af39 100755 --- a/llvm/utils/update_test_checks.py +++ b/llvm/utils/update_test_checks.py @@ -19,6 +19,7 @@ import re # RegEx: this is where the magic happens. +SCRUB_LEADING_WHITESPACE_RE = re.compile(r'^(\s+)') SCRUB_WHITESPACE_RE = re.compile(r'(?!^(| \w))[ \t]+', flags=re.M) SCRUB_TRAILING_WHITESPACE_RE = re.compile(r'[ \t]+$', flags=re.M) SCRUB_X86_SHUFFLES_RE = ( @@ -321,6 +322,8 @@ def main(): if is_in_function: if should_add_line_to_output(input_line, prefix_set) == True: # This input line of the function body will go as-is into the output. + # Except make leading whitespace uniform: 2 spaces. + input_line = SCRUB_LEADING_WHITESPACE_RE.sub(r' ', input_line) output_lines.append(input_line) else: continue -- 2.7.4