Code Style Checker: Fixed an issue in the SimplifyNodeVisitor class (Y108).

Sat, 17 Apr 2021 17:36:38 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 17 Apr 2021 17:36:38 +0200
changeset 8251
ee6af20714c3
parent 8250
4d65b3ec1d31
child 8253
40cf9093ef45

Code Style Checker: Fixed an issue in the SimplifyNodeVisitor class (Y108).

eric6.epj file | annotate | diff | comparison | revisions
eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyNodeVisitor.py file | annotate | diff | comparison | revisions
--- a/eric6.epj	Sat Apr 17 16:51:19 2021 +0200
+++ b/eric6.epj	Sat Apr 17 17:36:38 2021 +0200
@@ -8,8 +8,21 @@
     "CHECKERSPARMS": {
       "Pep8Checker": {
         "AnnotationsChecker": {
+          "AllowUntypedDefs": false,
+          "AllowUntypedNested": false,
+          "DispatchDecorators": [
+            "singledispatch",
+            "singledispatchmethod"
+          ],
           "MaximumComplexity": 3,
-          "MinimumCoverage": 75
+          "MaximumLength": 7,
+          "MinimumCoverage": 75,
+          "MypyInitReturn": false,
+          "OverloadDecorators": [
+            "overload"
+          ],
+          "SuppressDummyArgs": false,
+          "SuppressNoneReturning": true
         },
         "BlankLines": [
           2,
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyNodeVisitor.py	Sat Apr 17 16:51:19 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyNodeVisitor.py	Sat Apr 17 17:36:38 2021 +0200
@@ -654,12 +654,9 @@
             body = unparse(node.body[0].value)
             cond = unparse(node.test)
             orelse = unparse(node.orelse[0].value)
-            if len(
-                "{0} = {1} if {2} else {3}".format(assign, body, cond, orelse)
-            ) < 79:
-                # don't flag an issue, if the ternary would get too complicated
-                self.__error(node.lineno - 1, node.col_offset, "Y108",
-                             assign, body, cond, orelse)
+            
+            self.__error(node.lineno - 1, node.col_offset, "Y108",
+                         assign, body, cond, orelse)
     
     def __check109(self, node):
         """

eric ide

mercurial