Mon, 16 Jun 2014 18:27:11 +0200
Extended the syntax checker to check for VCS conflict markers left over from failed merges.
Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py | file | annotate | diff | comparison | revisions |
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py Sun Jun 15 18:56:56 2014 +0200 +++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py Mon Jun 16 18:27:11 2014 +0200 @@ -103,8 +103,14 @@ # unicode string' exception on Python2 codestring = normalizeCode(codestring) - # TODO: check for lines starting with VCS conflict markers - # (7 * c for c in "<>=|") and report as 'error' like syntax check + # Check for VCS conflict markers + lineindex = 1 + for line in codestring.splitlines(): + if any(line.startswith(c * 7) for c in "<>=|"): + return [{'error': + (file_enc, lineindex, 0, "", "VCS conflict marker found") + }] + lineindex += 1 if filename.endswith('.ptl'): try: