Code Style Checker: added configuration options for the reworked the type annotations checker to the code style checker dialog.

Sat, 17 Apr 2021 12:21:37 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 17 Apr 2021 12:21:37 +0200
changeset 8246
e4b95b0ebd31
parent 8245
dce55f623991
child 8247
e718d3a47f78

Code Style Checker: added configuration options for the reworked the type annotations checker to the code style checker dialog.

eric6.epj file | annotate | diff | comparison | revisions
eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsChecker.py file | annotate | diff | comparison | revisions
eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py file | annotate | diff | comparison | revisions
eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.ui file | annotate | diff | comparison | revisions
--- a/eric6.epj	Fri Apr 16 18:08:45 2021 +0200
+++ b/eric6.epj	Sat Apr 17 12:21:37 2021 +0200
@@ -2580,7 +2580,8 @@
       "eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py",
       "eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyNodeVisitor.py",
       "eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsFunctionVisitor.py",
-      "eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsEnums.py"
+      "eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsEnums.py",
+      "eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsCheckerDefaults.py"
     ],
     "SPELLEXCLUDES": "Dictionaries/excludes.dic",
     "SPELLLANGUAGE": "en_US",
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsChecker.py	Fri Apr 16 18:08:45 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsChecker.py	Sat Apr 17 12:21:37 2021 +0200
@@ -15,6 +15,7 @@
 import AstUtilities
 
 from .AnnotationsEnums import AnnotationType, ClassDecoratorType, FunctionType
+from .AnnotationsCheckerDefaults import AnnotationsCheckerDefaultArgs
 
 
 class AnnotationsChecker:
@@ -89,28 +90,6 @@
             (self.__checkAnnotationComplexity, ("A891", "A892")),
         ]
         
-        # TODO: the parameters to CodeStyleCheckerDialog
-        self.__defaultArgs = {
-            # Annotations
-            "SuppressNoneReturning": False,
-            "SuppressDummyArgs": False,
-            "AllowUntypedDefs": False,
-            "AllowUntypedNested": False,
-            "MypyInitReturn": False,
-            "DispatchDecorators": [
-                "singledispatch",
-                "singledispatchmethod",
-            ],
-            "OverloadDecorators": ["overload"],
-            
-            # Annotation Coverage
-            "MinimumCoverage": 75,      # % of type annotation coverage
-            
-            # Annotation Complexity
-            "MaximumComplexity": 3,
-            "MaximumLength": 7,
-        }
-        
         self.__checkers = []
         for checker, codes in checkersWithCodes:
             if any(not (code and self.__ignoreCode(code))
@@ -193,27 +172,27 @@
         """
         suppressNoneReturning = self.__args.get(
             "SuppressNoneReturning",
-            self.__defaultArgs["SuppressNoneReturning"])
+            AnnotationsCheckerDefaultArgs["SuppressNoneReturning"])
         suppressDummyArgs = self.__args.get(
             "SuppressDummyArgs",
-            self.__defaultArgs["SuppressDummyArgs"])
+            AnnotationsCheckerDefaultArgs["SuppressDummyArgs"])
         allowUntypedDefs = self.__args.get(
             "AllowUntypedDefs",
-            self.__defaultArgs["AllowUntypedDefs"])
+            AnnotationsCheckerDefaultArgs["AllowUntypedDefs"])
         allowUntypedNested = self.__args.get(
             "AllowUntypedNested",
-            self.__defaultArgs["AllowUntypedNested"])
+            AnnotationsCheckerDefaultArgs["AllowUntypedNested"])
         mypyInitReturn = self.__args.get(
             "MypyInitReturn",
-            self.__defaultArgs["MypyInitReturn"])
+            AnnotationsCheckerDefaultArgs["MypyInitReturn"])
         
         # Store decorator lists as sets for easier lookup
         dispatchDecorators = set(self.__args.get(
             "DispatchDecorators",
-            self.__defaultArgs["DispatchDecorators"]))
+            AnnotationsCheckerDefaultArgs["DispatchDecorators"]))
         overloadDecorators = set(self.__args.get(
             "OverloadDecorators",
-            self.__defaultArgs["OverloadDecorators"]))
+            AnnotationsCheckerDefaultArgs["OverloadDecorators"]))
         
         from .AnnotationsFunctionVisitor import FunctionVisitor
         visitor = FunctionVisitor(self.__source)
@@ -232,11 +211,11 @@
                 (allowUntypedDefs or
                  (function.isNested and allowUntypedNested))
             ):
-                # Skip yielding errors from dynamically typed functions
+                # Skip recording errors from dynamically typed functions
                 # or nested functions
                 continue
             
-            # Skip yielding errors for configured dispatch functions, such as
+            # Skip recording errors for configured dispatch functions, such as
             # (by default) `functools.singledispatch` and
             # `functools.singledispatchmethod`
             if function.hasDecorator(dispatchDecorators):
@@ -424,7 +403,7 @@
         Private method to check for function annotation coverage.
         """
         minAnnotationsCoverage = self.__args.get(
-            "MinimumCoverage", self.__defaultArgs["MinimumCoverage"])
+            "MinimumCoverage", AnnotationsCheckerDefaultArgs["MinimumCoverage"])
         if minAnnotationsCoverage == 0:
             # 0 means it is switched off
             return
@@ -479,10 +458,10 @@
         Private method to check the type annotation complexity.
         """
         maxAnnotationComplexity = self.__args.get(
-            "MaximumComplexity", self.__defaultArgs["MaximumComplexity"])
+            "MaximumComplexity", AnnotationsCheckerDefaultArgs["MaximumComplexity"])
         # TODO: include 'MaximumLength' in CodeStyleCheckerDialog
         maxAnnotationLength = self.__args.get(
-            "MaximumLength", self.__defaultArgs["MaximumLength"])
+            "MaximumLength", AnnotationsCheckerDefaultArgs["MaximumLength"])
         typeAnnotations = []
         
         functionDefs = [
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Fri Apr 16 18:08:45 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sat Apr 17 12:21:37 2021 +0200
@@ -33,11 +33,9 @@
 from .Miscellaneous.MiscellaneousDefaults import (
     MiscellaneousCheckerDefaultArgs
 )
-
-try:
-    basestring          # __IGNORE_WARNING__
-except Exception:
-    basestring = str    # define for Python3
+from .Annotations.AnnotationsCheckerDefaults import (
+    AnnotationsCheckerDefaultArgs
+)
 
 
 class CodeStyleCheckerDialog(QDialog, Ui_CodeStyleCheckerDialog):
@@ -515,10 +513,31 @@
             )
         
         if "AnnotationsChecker" not in self.__data:
-            self.__data["AnnotationsChecker"] = {
-                "MinimumCoverage": 75,
-                "MaximumComplexity": 3,
-            }
+            self.__data["AnnotationsChecker"] = copy.deepcopy(
+                AnnotationsCheckerDefaultArgs)
+        else:
+            # We are upgrading from an older data structure
+            if "MaximumLength" not in self.__data["AnnotationsChecker"]:
+                # MaximumLength is the sentinel for the first extension
+                self.__data["AnnotationsChecker"].extend({
+                    "MaximumLength":
+                        AnnotationsCheckerDefaultArgs["MaximumLength"],
+                    "SuppressNoneReturning":
+                        AnnotationsCheckerDefaultArgs["SuppressNoneReturning"],
+                    "SuppressDummyArgs":
+                        AnnotationsCheckerDefaultArgs["SuppressDummyArgs"],
+                    "AllowUntypedDefs":
+                        AnnotationsCheckerDefaultArgs["AllowUntypedDefs"],
+                    "AllowUntypedNested":
+                        AnnotationsCheckerDefaultArgs["AllowUntypedNested"],
+                    "MypyInitReturn":
+                        AnnotationsCheckerDefaultArgs["MypyInitReturn"],
+                    "DispatchDecorators":
+                        AnnotationsCheckerDefaultArgs["DispatchDecorators"],
+                    "OverloadDecorators":
+                        AnnotationsCheckerDefaultArgs["OverloadDecorators"],
+                })
+        # TODO: add additional AnnotationsChecker parameters
         
         if "SecurityChecker" not in self.__data:
             from .Security.SecurityDefaults import SecurityDefaults
@@ -575,10 +594,31 @@
             self.__data["CommentedCodeChecker"]["Aggressive"])
         self.__initCommentedCodeCheckerWhiteList(
             self.__data["CommentedCodeChecker"]["WhiteList"])
+        
+        # type annotations
         self.minAnnotationsCoverageSpinBox.setValue(
             self.__data["AnnotationsChecker"]["MinimumCoverage"])
         self.maxAnnotationsComplexitySpinBox.setValue(
             self.__data["AnnotationsChecker"]["MaximumComplexity"])
+        self.maxAnnotationsLengthSpinBox.setValue(
+            self.__data["AnnotationsChecker"]["MaximumLength"])
+        self.suppressNoneReturningCheckBox.setChecked(
+            self.__data["AnnotationsChecker"]["SuppressNoneReturning"])
+        self.suppressDummyArgsCheckBox.setChecked(
+            self.__data["AnnotationsChecker"]["SuppressDummyArgs"])
+        self.allowUntypedDefsCheckBox.setChecked(
+            self.__data["AnnotationsChecker"]["AllowUntypedDefs"])
+        self.allowUntypedNestedCheckBox.setChecked(
+            self.__data["AnnotationsChecker"]["AllowUntypedNested"])
+        self.mypyInitReturnCheckBox.setChecked(
+            self.__data["AnnotationsChecker"]["MypyInitReturn"])
+        self.dispatchDecoratorEdit.setText(
+            ", ".join(
+                self.__data["AnnotationsChecker"]["DispatchDecorators"]))
+        self.overloadDecoratorEdit.setText(
+            ", ".join(
+                self.__data["AnnotationsChecker"]["OverloadDecorators"]))
+        # TODO: add additional AnnotationsChecker parameters
         
         # security
         self.tmpDirectoriesEdit.setPlainText("\n".join(
@@ -730,12 +770,32 @@
                     "WhiteList": self.__getCommentedCodeCheckerWhiteList(),
                 }
             }
+            
             annotationArgs = {
                 "MinimumCoverage":
                     self.minAnnotationsCoverageSpinBox.value(),
                 "MaximumComplexity":
                     self.maxAnnotationsComplexitySpinBox.value(),
+                "MaximumLength":
+                    self.maxAnnotationsLengthSpinBox.value(),
+                "SuppressNoneReturning":
+                    self.suppressNoneReturningCheckBox.isChecked(),
+                "SuppressDummyArgs":
+                    self.suppressDummyArgsCheckBox.isChecked(),
+                "AllowUntypedDefs":
+                    self.allowUntypedDefsCheckBox.isChecked(),
+                "AllowUntypedNested":
+                    self.allowUntypedNestedCheckBox.isChecked(),
+                "MypyInitReturn":
+                    self.mypyInitReturnCheckBox.isChecked(),
+                "DispatchDecorators":
+                    [d.strip()
+                     for d in self.dispatchDecoratorEdit.text().split(",")],
+                "OverloadDecorators":
+                    [d.strip()
+                     for d in self.overloadDecoratorEdit.text().split(",")],
             }
+            # TODO: add additional AnnotationsChecker parameters
             
             securityArgs = {
                 "hardcoded_tmp_directories": [
@@ -803,7 +863,7 @@
         """
         options = self.__options[:]
         flags = Utilities.extractFlags(source)
-        if "noqa" in flags and isinstance(flags["noqa"], basestring):
+        if "noqa" in flags and isinstance(flags["noqa"], str):
             excludeMessages = options[0].strip().rstrip(",")
             if excludeMessages:
                 excludeMessages += ","
@@ -1147,7 +1207,28 @@
                         self.minAnnotationsCoverageSpinBox.value(),
                     "MaximumComplexity":
                         self.maxAnnotationsComplexitySpinBox.value(),
+                    "MaximumLength":
+                        self.maxAnnotationsLengthSpinBox.value(),
+                    "SuppressNoneReturning":
+                        self.suppressNoneReturningCheckBox.isChecked(),
+                    "SuppressDummyArgs":
+                        self.suppressDummyArgsCheckBox.isChecked(),
+                    "AllowUntypedDefs":
+                        self.allowUntypedDefsCheckBox.isChecked(),
+                    "AllowUntypedNested":
+                        self.allowUntypedNestedCheckBox.isChecked(),
+                    "MypyInitReturn":
+                        self.mypyInitReturnCheckBox.isChecked(),
+                    "DispatchDecorators":
+                        [d.strip()
+                         for d in self.dispatchDecoratorEdit.text().split(",")
+                         ],
+                    "OverloadDecorators":
+                        [d.strip()
+                         for d in self.overloadDecoratorEdit.text().split(",")
+                         ],
                 },
+                # TODO: add additional AnnotationsChecker parameters
                 "SecurityChecker": {
                     "HardcodedTmpDirectories": [
                         t.strip()
@@ -1434,12 +1515,49 @@
                     "CommentedCodeChecker"]["WhiteList"]
             )
         ))
+        
+        # type annotations
         self.minAnnotationsCoverageSpinBox.setValue(int(
             Preferences.Prefs.settings.value(
-                "PEP8/MinimumAnnotationsCoverage", 75)))
+                "PEP8/MinimumAnnotationsCoverage",
+                AnnotationsCheckerDefaultArgs["MinimumCoverage"])))
         self.maxAnnotationsComplexitySpinBox.setValue(int(
             Preferences.Prefs.settings.value(
-                "PEP8/MaximumAnnotationComplexity", 3)))
+                "PEP8/MaximumAnnotationComplexity",
+                AnnotationsCheckerDefaultArgs["MaximumComplexity"])))
+        self.maxAnnotationsLengthSpinBox.setValue(int(
+            Preferences.Prefs.settings.value(
+                "PEP8/MaximumAnnotationLength",
+                AnnotationsCheckerDefaultArgs["MaximumLength"])))
+        self.suppressNoneReturningCheckBox.setChecked(Preferences.toBool(
+            Preferences.Prefs.settings.value(
+                "PEP8/SuppressNoneReturning",
+                AnnotationsCheckerDefaultArgs["SuppressNoneReturning"])))
+        self.suppressDummyArgsCheckBox.setChecked(Preferences.toBool(
+            Preferences.Prefs.settings.value(
+                "PEP8/SuppressDummyArgs",
+                AnnotationsCheckerDefaultArgs["SuppressDummyArgs"])))
+        self.allowUntypedDefsCheckBox.setChecked(Preferences.toBool(
+            Preferences.Prefs.settings.value(
+                "PEP8/AllowUntypedDefs",
+                AnnotationsCheckerDefaultArgs["AllowUntypedDefs"])))
+        self.allowUntypedNestedCheckBox.setChecked(Preferences.toBool(
+            Preferences.Prefs.settings.value(
+                "PEP8/AllowUntypedNested",
+                AnnotationsCheckerDefaultArgs["AllowUntypedNested"])))
+        self.mypyInitReturnCheckBox.setChecked(Preferences.toBool(
+            Preferences.Prefs.settings.value(
+                "PEP8/MypyInitReturn",
+                AnnotationsCheckerDefaultArgs["MypyInitReturn"])))
+        self.dispatchDecoratorEdit.setText(", ".join(Preferences.toList(
+            Preferences.Prefs.settings.value(
+                "PEP8/DispatchDecorators",
+                AnnotationsCheckerDefaultArgs["DispatchDecorators"]))))
+        self.overloadDecoratorEdit.setText(", ".join(Preferences.toList(
+            Preferences.Prefs.settings.value(
+                "PEP8/OverloadDecorators",
+                AnnotationsCheckerDefaultArgs["OverloadDecorators"]))))
+        # TODO: add additional AnnotationsChecker parameters
         
         # security
         from .Security.SecurityDefaults import SecurityDefaults
@@ -1547,12 +1665,41 @@
         Preferences.Prefs.settings.setValue(
             "PEP8/CommentedCodeWhitelist",
             self.__getCommentedCodeCheckerWhiteList())
+        
+        # type annotations
         Preferences.Prefs.settings.setValue(
             "PEP8/MinimumAnnotationsCoverage",
             self.minAnnotationsCoverageSpinBox.value())
         Preferences.Prefs.settings.setValue(
             "PEP8/MaximumAnnotationComplexity",
             self.maxAnnotationsComplexitySpinBox.value())
+        Preferences.Prefs.settings.setValue(
+            "PEP8/MaximumAnnotationLength",
+            self.maxAnnotationsLengthSpinBox.value())
+        Preferences.Prefs.settings.setValue(
+            "PEP8/SuppressNoneReturning",
+            self.suppressNoneReturningCheckBox.isChecked())
+        Preferences.Prefs.settings.setValue(
+            "PEP8/SuppressDummyArgs",
+            self.suppressDummyArgsCheckBox.isChecked())
+        Preferences.Prefs.settings.setValue(
+            "PEP8/AllowUntypedDefs",
+            self.allowUntypedDefsCheckBox.isChecked())
+        Preferences.Prefs.settings.setValue(
+            "PEP8/AllowUntypedNested",
+            self.allowUntypedNestedCheckBox.isChecked())
+        Preferences.Prefs.settings.setValue(
+            "PEP8/MypyInitReturn",
+            self.mypyInitReturnCheckBox.isChecked())
+        Preferences.Prefs.settings.setValue(
+            "PEP8/DispatchDecorators",
+            [d.strip()
+             for d in self.dispatchDecoratorEdit.text().split(",")])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/OverloadDecorators",
+            [d.strip()
+             for d in self.overloadDecoratorEdit.text().split(",")])
+        # TODO: add additional AnnotationsChecker parameters
         
         # security
         Preferences.Prefs.settings.setValue(
@@ -1650,10 +1797,39 @@
             MiscellaneousCheckerDefaultArgs[
                 "CommentedCodeChecker"]["WhiteList"]
         )
+        
+        # type annotations
         Preferences.Prefs.settings.setValue(
-            "PEP8/MinimumAnnotationsCoverage", 75)
+            "PEP8/MinimumAnnotationsCoverage",
+            AnnotationsCheckerDefaultArgs["MinimumCoverage"])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/MaximumAnnotationComplexity",
+            AnnotationsCheckerDefaultArgs["MaximumComplexity"])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/MaximumAnnotationLength",
+            AnnotationsCheckerDefaultArgs["MaximumLength"])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/SuppressNoneReturning",
+            AnnotationsCheckerDefaultArgs["SuppressNoneReturning"])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/SuppressDummyArgs",
+            AnnotationsCheckerDefaultArgs["SuppressDummyArgs"])
         Preferences.Prefs.settings.setValue(
-            "PEP8/MaximumAnnotationComplexity", 3)
+            "PEP8/AllowUntypedDefs",
+            AnnotationsCheckerDefaultArgs["AllowUntypedDefs"])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/AllowUntypedNested",
+            AnnotationsCheckerDefaultArgs["AllowUntypedNested"])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/MypyInitReturn",
+            AnnotationsCheckerDefaultArgs["MypyInitReturn"])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/DispatchDecorators",
+            AnnotationsCheckerDefaultArgs["DispatchDecorators"])
+        Preferences.Prefs.settings.setValue(
+            "PEP8/OverloadDecorators",
+            AnnotationsCheckerDefaultArgs["OverloadDecorators"])
+        # TODO: add additional AnnotationsChecker parameters
         
         # security
         from .Security.SecurityDefaults import SecurityDefaults
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.ui	Fri Apr 16 18:08:45 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.ui	Sat Apr 17 12:21:37 2021 +0200
@@ -21,7 +21,7 @@
   <property name="sizeGripEnabled">
    <bool>true</bool>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout_9">
+  <layout class="QVBoxLayout" name="verticalLayout_13">
    <item>
     <widget class="QTabWidget" name="mainWidget">
      <property name="currentIndex">
@@ -232,7 +232,7 @@
           <attribute name="title">
            <string>Specific Options</string>
           </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_4">
+          <layout class="QVBoxLayout" name="verticalLayout_9">
            <item>
             <widget class="QScrollArea" name="scrollArea">
              <property name="frameShape">
@@ -252,11 +252,11 @@
                <rect>
                 <x>0</x>
                 <y>0</y>
-                <width>389</width>
-                <height>1178</height>
+                <width>611</width>
+                <height>1417</height>
                </rect>
               </property>
-              <layout class="QVBoxLayout" name="verticalLayout_3">
+              <layout class="QVBoxLayout" name="verticalLayout_4">
                <item>
                 <widget class="QGroupBox" name="groupBox">
                  <property name="title">
@@ -800,60 +800,175 @@
                  <property name="title">
                   <string>Type Annotations</string>
                  </property>
-                 <layout class="QGridLayout" name="gridLayout_6">
-                  <item row="0" column="0">
-                   <widget class="QLabel" name="label_18">
-                    <property name="text">
-                     <string>Min. Coverage:</string>
-                    </property>
-                   </widget>
+                 <layout class="QVBoxLayout" name="verticalLayout_3">
+                  <item>
+                   <layout class="QGridLayout" name="gridLayout_6">
+                    <item row="0" column="0">
+                     <widget class="QLabel" name="label_18">
+                      <property name="text">
+                       <string>Min. Coverage:</string>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="0" column="1">
+                     <widget class="QSpinBox" name="minAnnotationsCoverageSpinBox">
+                      <property name="toolTip">
+                       <string>Enter the minimum percentage of type annotations</string>
+                      </property>
+                      <property name="alignment">
+                       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                      </property>
+                      <property name="specialValueText">
+                       <string>off</string>
+                      </property>
+                      <property name="suffix">
+                       <string>%</string>
+                      </property>
+                      <property name="maximum">
+                       <number>100</number>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="0" column="2">
+                     <spacer name="horizontalSpacer_7">
+                      <property name="orientation">
+                       <enum>Qt::Horizontal</enum>
+                      </property>
+                      <property name="sizeHint" stdset="0">
+                       <size>
+                        <width>352</width>
+                        <height>20</height>
+                       </size>
+                      </property>
+                     </spacer>
+                    </item>
+                    <item row="1" column="0">
+                     <widget class="QLabel" name="label_19">
+                      <property name="text">
+                       <string>Max. Complexity:</string>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="1" column="1">
+                     <widget class="QSpinBox" name="maxAnnotationsComplexitySpinBox">
+                      <property name="toolTip">
+                       <string>Enter the maximum type annotation complexity</string>
+                      </property>
+                      <property name="alignment">
+                       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                      </property>
+                      <property name="minimum">
+                       <number>1</number>
+                      </property>
+                      <property name="maximum">
+                       <number>9</number>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="2" column="0">
+                     <widget class="QLabel" name="label_32">
+                      <property name="text">
+                       <string>Max. Length:</string>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="2" column="1">
+                     <widget class="QSpinBox" name="maxAnnotationsLengthSpinBox">
+                      <property name="toolTip">
+                       <string>Enter the maximum type annotation length</string>
+                      </property>
+                      <property name="alignment">
+                       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                      </property>
+                      <property name="minimum">
+                       <number>1</number>
+                      </property>
+                      <property name="maximum">
+                       <number>15</number>
+                      </property>
+                     </widget>
+                    </item>
+                   </layout>
                   </item>
-                  <item row="0" column="1">
-                   <widget class="QSpinBox" name="minAnnotationsCoverageSpinBox">
-                    <property name="toolTip">
-                     <string>Enter the minimum percentage of type annotations</string>
-                    </property>
-                    <property name="specialValueText">
-                     <string>off</string>
-                    </property>
-                    <property name="suffix">
-                     <string>%</string>
-                    </property>
-                    <property name="maximum">
-                     <number>100</number>
+                  <item>
+                   <layout class="QGridLayout" name="gridLayout_9">
+                    <item row="0" column="0">
+                     <widget class="QCheckBox" name="suppressNoneReturningCheckBox">
+                      <property name="toolTip">
+                       <string>Select to not report functions without returns or with only bare returns</string>
+                      </property>
+                      <property name="text">
+                       <string>Suppress 'None' return</string>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="0" column="1">
+                     <widget class="QCheckBox" name="suppressDummyArgsCheckBox">
+                      <property name="toolTip">
+                       <string>Select to not report dummy (i.e. '_') arguments </string>
+                      </property>
+                      <property name="text">
+                       <string>Suppress Dummy Arguments</string>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="1" column="0">
+                     <widget class="QCheckBox" name="allowUntypedDefsCheckBox">
+                      <property name="toolTip">
+                       <string>Select to not report dynamically typed functions</string>
+                      </property>
+                      <property name="text">
+                       <string>Allow Untyped Functions</string>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="1" column="1">
+                     <widget class="QCheckBox" name="allowUntypedNestedCheckBox">
+                      <property name="toolTip">
+                       <string>Select to not report dynamically typed nested functions</string>
+                      </property>
+                      <property name="text">
+                       <string>Allow Untyped Nested Functions</string>
+                      </property>
+                     </widget>
+                    </item>
+                    <item row="2" column="0" colspan="2">
+                     <widget class="QCheckBox" name="mypyInitReturnCheckBox">
+                      <property name="toolTip">
+                       <string>Select to not report unhinted '__init__' return</string>
+                      </property>
+                      <property name="text">
+                       <string>Allow Untyped '__init__' function</string>
+                      </property>
+                     </widget>
+                    </item>
+                   </layout>
+                  </item>
+                  <item>
+                   <widget class="QLabel" name="label_33">
+                    <property name="text">
+                     <string>Dispatch Decorators:</string>
                     </property>
                    </widget>
                   </item>
-                  <item row="0" column="2">
-                   <spacer name="horizontalSpacer_7">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>352</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item row="1" column="0">
-                   <widget class="QLabel" name="label_19">
-                    <property name="text">
-                     <string>Max. Complexity:</string>
+                  <item>
+                   <widget class="E5ClearableLineEdit" name="dispatchDecoratorEdit">
+                    <property name="toolTip">
+                     <string>Enter the list of dispatch decorators separated by comma</string>
                     </property>
                    </widget>
                   </item>
-                  <item row="1" column="1">
-                   <widget class="QSpinBox" name="maxAnnotationsComplexitySpinBox">
-                    <property name="toolTip">
-                     <string>Enter the maximum type annotation complexity</string>
+                  <item>
+                   <widget class="QLabel" name="label_34">
+                    <property name="text">
+                     <string>Overload Decorators:</string>
                     </property>
-                    <property name="minimum">
-                     <number>1</number>
-                    </property>
-                    <property name="maximum">
-                     <number>9</number>
+                   </widget>
+                  </item>
+                  <item>
+                   <widget class="E5ClearableLineEdit" name="overloadDecoratorEdit">
+                    <property name="toolTip">
+                     <string>Enter the list of typing.overload decorators separated by comma</string>
                     </property>
                    </widget>
                   </item>
@@ -1507,6 +1622,14 @@
   <tabstop>lineComplexityScoreSpinBox</tabstop>
   <tabstop>minAnnotationsCoverageSpinBox</tabstop>
   <tabstop>maxAnnotationsComplexitySpinBox</tabstop>
+  <tabstop>maxAnnotationsLengthSpinBox</tabstop>
+  <tabstop>suppressNoneReturningCheckBox</tabstop>
+  <tabstop>suppressDummyArgsCheckBox</tabstop>
+  <tabstop>allowUntypedDefsCheckBox</tabstop>
+  <tabstop>allowUntypedNestedCheckBox</tabstop>
+  <tabstop>mypyInitReturnCheckBox</tabstop>
+  <tabstop>dispatchDecoratorEdit</tabstop>
+  <tabstop>overloadDecoratorEdit</tabstop>
   <tabstop>tmpDirectoriesEdit</tabstop>
   <tabstop>hashesEdit</tabstop>
   <tabstop>insecureSslProtocolsEdit</tabstop>
@@ -1528,6 +1651,8 @@
   <tabstop>fixButton</tabstop>
   <tabstop>showButton</tabstop>
   <tabstop>statisticsButton</tabstop>
+  <tabstop>filterComboBox</tabstop>
+  <tabstop>filterButton</tabstop>
  </tabstops>
  <resources/>
  <connections>

eric ide

mercurial