Fixed an issue in the coding style checker service. Empty files should not be ignored because they could show issues. 5_5_x

Sat, 27 Sep 2014 12:34:27 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Sep 2014 12:34:27 +0200
branch
5_5_x
changeset 3820
c00bdab507ef
parent 3815
7dadfde0f017
child 3823
0ea489eea09c

Fixed an issue in the coding style checker service. Empty files should not be ignored because they could show issues.

Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py file | annotate | diff | comparison | revisions
Utilities/BackgroundService.py file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Tue Sep 23 18:58:33 2014 +0200
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Sat Sep 27 12:34:27 2014 +0200
@@ -104,9 +104,6 @@
         hangClosing, docType, errors, eol, encoding, backup = args
     
     stats = {}
-    # Don't check an empty file
-    if source == []:
-        return stats, []
 
     if fixIssues:
         from CodeStyleFixer import CodeStyleFixer
@@ -162,20 +159,27 @@
     for fname, lineno, position, text in errors:
         if lineno > len(source):
             lineno = len(source)
-        if "__IGNORE_WARNING__" not in \
-                extractLineFlags(source[lineno - 1].strip()):
-            if fixer:
-                res, msg, id_ = fixer.fixIssue(lineno, position, text)
-                if res == -1:
-                    itm = [lineno, position, text]
-                    deferredFixes[id_] = itm
+        if source:
+            if "__IGNORE_WARNING__" not in \
+                    extractLineFlags(source[lineno - 1].strip()):
+                if fixer:
+                    res, msg, id_ = fixer.fixIssue(lineno, position, text)
+                    if res == -1:
+                        itm = [lineno, position, text]
+                        deferredFixes[id_] = itm
+                    else:
+                        itm = [lineno, position, text, False,
+                               res == 1, True, msg]
                 else:
-                    itm = [lineno, position, text, False, res == 1, True, msg]
+                    itm = [lineno, position, text, False,
+                           False, False, '']
+                results.append(itm)
             else:
-                itm = [lineno, position, text, False, False, False, '']
-            results.append(itm)
+                results.append([lineno, position, text, True,
+                                False, False, ''])
         else:
-            results.append([lineno, position, text, True, False, False, ''])
+            results.append([lineno, position, text, False,
+                            False, False, ''])
     
     if fixer:
         deferredResults = fixer.finalize()
--- a/Utilities/BackgroundService.py	Tue Sep 23 18:58:33 2014 +0200
+++ b/Utilities/BackgroundService.py	Sat Sep 27 12:34:27 2014 +0200
@@ -84,6 +84,7 @@
             getConfig('ericDir'),
             "Utilities", "BackgroundClient.py")
         proc = QProcess()
+        proc.setProcessChannelMode(QProcess.ForwardedChannels)
         args = [backgroundClient, self.hostAddress, str(port)]
         proc.start(interpreter, args)
         if not proc.waitForStarted(10000):

eric ide

mercurial