src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleStatisticsDialog.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9473
3f23dbf37dbe
diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleStatisticsDialog.py
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleStatisticsDialog.py	Wed Jul 13 11:16:20 2022 +0200
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleStatisticsDialog.py	Wed Jul 13 14:55:47 2022 +0200
@@ -25,10 +25,11 @@
     Class implementing a dialog showing statistical data for the last
     code style checker run.
     """
+
     def __init__(self, statisticData, parent=None):
         """
         Constructor
-        
+
         @param statisticData dictionary with the statistical data
         @type dict
         @param parent reference to the parent widget
@@ -36,7 +37,7 @@
         """
         super().__init__(parent)
         self.setupUi(self)
-        
+
         stats = statisticData.copy()
         filesCount = stats["_FilesCount"]
         filesIssues = stats["_FilesIssues"]
@@ -46,43 +47,42 @@
         del stats["_FilesIssues"]
         del stats["_IssuesFixed"]
         del stats["_SecurityOK"]
-        
+
         totalIssues = 0
         ignoresCount = 0
-        
+
         textWrapper = textwrap.TextWrapper(width=80)
-        
+
         for msgCode in sorted(stats.keys()):
             message = getTranslatedMessage(msgCode, [], example=True)
             if message is None:
                 continue
-            
-            self.__createItem(stats[msgCode], msgCode,
-                              "\n".join(textWrapper.wrap(message)))
+
+            self.__createItem(
+                stats[msgCode], msgCode, "\n".join(textWrapper.wrap(message))
+            )
             totalIssues += stats[msgCode]["total"]
             ignoresCount += stats[msgCode]["ignored"]
-        
-        self.totalIssues.setText(
-            self.tr("%n issue(s) found", "", totalIssues))
-        self.ignoredIssues.setText(
-            self.tr("%n issue(s) ignored", "", ignoresCount))
-        self.fixedIssues.setText(
-            self.tr("%n issue(s) fixed", "", fixesCount))
-        self.filesChecked.setText(
-            self.tr("%n file(s) checked", "", filesCount))
+
+        self.totalIssues.setText(self.tr("%n issue(s) found", "", totalIssues))
+        self.ignoredIssues.setText(self.tr("%n issue(s) ignored", "", ignoresCount))
+        self.fixedIssues.setText(self.tr("%n issue(s) fixed", "", fixesCount))
+        self.filesChecked.setText(self.tr("%n file(s) checked", "", filesCount))
         self.filesIssues.setText(
-            self.tr("%n file(s) with issues found", "", filesIssues))
+            self.tr("%n file(s) with issues found", "", filesIssues)
+        )
         self.securityOk.setText(
-            self.tr("%n security issue(s) acknowledged", "", securityOk))
-        
+            self.tr("%n security issue(s) acknowledged", "", securityOk)
+        )
+
         self.statisticsList.resizeColumnToContents(0)
         self.statisticsList.resizeColumnToContents(1)
         self.statisticsList.resizeColumnToContents(2)
-    
+
     def __createItem(self, counts, msgCode, message):
         """
         Private method to create an entry in the result list.
-        
+
         @param counts dictionary containing the total and ignored occurrences
             of the issue
         @type dict
@@ -91,14 +91,23 @@
         @param message code style issue message to be shown
         @type str
         """
-        itm = QTreeWidgetItem(self.statisticsList, [
-            msgCode, "{0:6d}".format(counts["total"] - counts["ignored"]),
-            "{0:6d}".format(counts["ignored"]), message])
+        itm = QTreeWidgetItem(
+            self.statisticsList,
+            [
+                msgCode,
+                "{0:6d}".format(counts["total"] - counts["ignored"]),
+                "{0:6d}".format(counts["ignored"]),
+                message,
+            ],
+        )
         CodeStyleCheckerUtilities.setItemIcon(itm, 0, msgCode)
-        
+
         itm.setTextAlignment(
-            0, Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignVCenter)
+            0, Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignVCenter
+        )
         itm.setTextAlignment(
-            1, Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter)
+            1, Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter
+        )
         itm.setTextAlignment(
-            2, Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter)
+            2, Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter
+        )

eric ide

mercurial