Skip to content

Commit

Permalink
add scrubber for excessive leading whitespace
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264542 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rotateright committed Mar 27, 2016
1 parent c45f2af commit a21dabc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/update_test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# 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 = (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a21dabc

Please sign in to comment.