diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -10,9 +10,9 @@ import sys, re, glob def repquote(m): - t = re.sub(r"\w", "x", m.group(2)) + t = re.sub(r"\w", "x", m.group('text')) t = re.sub(r"[^\sx]", "o", t) - return m.group(1) + t + m.group(1) + return m.group('quote') + t + m.group('quote') def repcomment(m): return m.group(1) + "#" * len(m.group(2)) @@ -96,10 +96,9 @@ pypats = [ ] pyfilters = [ - (r'''(?('''|\"\"\"|(?(.*?)) + (?(?([^"]|\\")+)"(?!")''', repquote), (r'''(#\s*include\s+<)([^>]+)>''', repinclude), (r'(\()([^)]+\))', repcallspaces), ] diff --git a/tests/test-check-code b/tests/test-check-code --- a/tests/test-check-code +++ b/tests/test-check-code @@ -12,5 +12,13 @@ def toto( arg1, arg2): return ( 5+6, 9) EOF +cat > quote.py < return ( 5+6, 9) missing whitespace in expression gratuitous whitespace in () or [] +./quote.py:4: + > '"""', 42+1, """and + missing whitespace in expression