# HG changeset patch # User Sjoerd Mullender <sjoerd@acm.org> # Date 1333398487 -7200 # Node ID adc4e99b4a4ad72c31e50ff5bc84c86b41be12b9 # Parent c3189b0338991c661c3c500aa15f7ef23296cc15 Added test for conflict markers. diff -r c3189b033899 -r adc4e99b4a4a check_whitespace.py --- a/check_whitespace.py Sun Jun 20 16:47:47 2010 +0200 +++ b/check_whitespace.py Mon Apr 02 22:28:07 2012 +0200 @@ -16,6 +16,7 @@ lnre = re.compile(r'@@ -\d+,\d+ \+(?P<lineno>\d+),') wsre = re.compile(r'\+.*[ \t]$') tbre = re.compile(r'\+.*\t') + resre = re.compile(r'\+(<<<<<<<|>>>>>>>)') for line in difflines: if header: @@ -41,10 +42,15 @@ m = tbre.match(line) if m is not None: yield filename, linenum, 'TABs' + # trailing whitespace, for now only in Python source m = wsre.match(line) if m is not None: if filename[-3:] == '.py' or filename[-5:] == '.py.in': yield filename, linenum, 'trailing whitespace' + # conflict markers + m = resre.match(line) + if m is not None: + yield filename, linenum, 'conflict marker' if line and line[0] in ' +': linenum += 1