Unverified Commit 2c1fe88d authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Fix indentation issue with block quote pre-commit script (#868)

parent 9efbb661
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@ def fix_lines(lines):

        # Format block quotes
        elif state == State.InsideBlockQuote:
            if first_inner_indent == None and len(line.strip()) == 0:
                continue

            current_indent = line_indent(line)
            # Track the first line's indentation inside of the block quote
            # so that relative indentation can be preserved.
@@ -253,6 +256,11 @@ class SelfTest(unittest.TestCase):
            input = ['    """', '  asdf {', '      asdf', '  }', '"""'], \
            lines_changed = [2, 3, 4, 5] \
        )
        self.fix_lines_test_case( \
            expected = ['    """', '', '    foo', '    bar', '    """'], \
            input = ['    """', '', '    foo', '    bar', '    """'], \
            lines_changed = [] \
        )

def main():
    # Run unit tests if given `--self-test` argument