Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

branch
5_4_x
changeset 3819
4cef255aef4b
parent 3818
2155e837ee74
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sat Sep 27 11:34:38 2014 +0200
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sat Sep 27 11:56:21 2014 +0200
@@ -475,33 +475,38 @@
                         fname, lineno, position, text = error
                         if lineno > len(source):
                             lineno = len(source)
-                        if source and \
-                            "__IGNORE_WARNING__" not in \
-                            Utilities.extractLineFlags(
-                                source[lineno - 1].strip()):
-                            self.noResults = False
-                            if fixer:
-                                res, msg, id_ = fixer.fixIssue(lineno,
-                                                               position, text)
-                                if res == 1:
-                                    text += "\n" + \
+                        if source:
+                            if "__IGNORE_WARNING__" not in \
+                                Utilities.extractLineFlags(
+                                    source[lineno - 1].strip()):
+                                self.noResults = False
+                                if fixer:
+                                    res, msg, id_ = fixer.fixIssue(
+                                        lineno, position, text)
+                                    if res == 1:
+                                        text += "\n" + \
                                             self.trUtf8("Fix: {0}").format(msg)
-                                    self.__createResultItem(
-                                        fname, lineno, position, text, True,
-                                        True)
-                                elif res == 0:
+                                        self.__createResultItem(
+                                            fname, lineno, position, text,
+                                            True, True)
+                                    elif res == 0:
+                                        self.__createResultItem(
+                                            fname, lineno, position, text,
+                                            False, True)
+                                    else:
+                                        itm = self.__createResultItem(
+                                            fname, lineno, position,
+                                            text, False, False)
+                                        deferredFixes[id_] = itm
+                                else:
                                     self.__createResultItem(
                                         fname, lineno, position, text, False,
-                                        True)
-                                else:
-                                    itm = self.__createResultItem(
-                                        fname, lineno, position,
-                                        text, False, False)
-                                    deferredFixes[id_] = itm
-                            else:
-                                self.__createResultItem(
-                                    fname, lineno, position, text, False,
-                                    False)
+                                        False)
+                        else:
+                            self.noResults = False
+                            self.__createResultItem(
+                                fname, lineno, position, text, False,
+                                False)
                     if fixer:
                         deferredResults = fixer.finalize()
                         for id_ in deferredResults:

eric ide

mercurial