Extended the syntax checker to check for VCS conflict markers left over from failed merges.

Mon, 16 Jun 2014 18:27:11 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 16 Jun 2014 18:27:11 +0200
changeset 3635
fc024806236d
parent 3633
869c7cb9dc15
child 3636
91102b757bef

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
diff -r 869c7cb9dc15 -r fc024806236d Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py
--- 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:

eric ide

mercurial