eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

branch
eric7
changeset 9176
193da71cc417
parent 8943
23f9c7b9e18e
child 9182
bc72e2fc0d8e
--- a/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sun Jun 26 15:01:48 2022 +0200
+++ b/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sun Jun 26 15:16:51 2022 +0200
@@ -473,10 +473,11 @@
             self.__data["EnabledCheckerCategories"] = ",".join(
                 CodeStyleCheckerDialog.checkCategories.keys())
         if "MaxLineLength" not in self.__data:
-            self.__data["MaxLineLength"] = pycodestyle.MAX_LINE_LENGTH
+            self.__data["MaxLineLength"] = 88
+            # better code formatting than pycodestyle.MAX_LINE_LENGTH
+            # see the Black tool
         if "MaxDocLineLength" not in self.__data:
-            # Use MAX_LINE_LENGTH to avoid messages on existing code
-            self.__data["MaxDocLineLength"] = pycodestyle.MAX_LINE_LENGTH
+            self.__data["MaxDocLineLength"] = 88
         if "BlankLines" not in self.__data:
             self.__data["BlankLines"] = (2, 1)
             # top level, method
@@ -1492,12 +1493,10 @@
             Preferences.getSettings().value("PEP8/FixIssues", False)))
         self.ignoredCheckBox.setChecked(Preferences.toBool(
             Preferences.getSettings().value("PEP8/ShowIgnored", False)))
-        self.lineLengthSpinBox.setValue(int(Preferences.getSettings().value(
-            "PEP8/MaxLineLength", pycodestyle.MAX_LINE_LENGTH)))
-        # Use MAX_LINE_LENGTH to avoid messages on existing code
+        self.lineLengthSpinBox.setValue(int(
+            Preferences.getSettings().value("PEP8/MaxLineLength", 88)))
         self.docLineLengthSpinBox.setValue(int(
-            Preferences.getSettings().value(
-                "PEP8/MaxDocLineLength", pycodestyle.MAX_LINE_LENGTH)))
+            Preferences.getSettings().value("PEP8/MaxDocLineLength", 88)))
         self.blankBeforeTopLevelSpinBox.setValue(
             int(Preferences.getSettings().value(
                 "PEP8/BlankLinesBeforeTopLevel", 2)))
@@ -1815,15 +1814,10 @@
         Preferences.getSettings().setValue("PEP8/NoFixCodes", "E501")
         Preferences.getSettings().setValue("PEP8/FixIssues", False)
         Preferences.getSettings().setValue("PEP8/ShowIgnored", False)
-        Preferences.getSettings().setValue(
-            "PEP8/MaxLineLength", pycodestyle.MAX_LINE_LENGTH)
-        # Hard reset to pycodestyle preferences
-        Preferences.getSettings().setValue(
-            "PEP8/MaxDocLineLength", pycodestyle.MAX_DOC_LENGTH)
-        Preferences.getSettings().setValue(
-            "PEP8/BlankLinesBeforeTopLevel", 2)
-        Preferences.getSettings().setValue(
-            "PEP8/BlankLinesBeforeMethod", 1)
+        Preferences.getSettings().setValue("PEP8/MaxLineLength", 88)
+        Preferences.getSettings().setValue("PEP8/MaxDocLineLength", 88)
+        Preferences.getSettings().setValue("PEP8/BlankLinesBeforeTopLevel", 2)
+        Preferences.getSettings().setValue("PEP8/BlankLinesBeforeMethod", 1)
         Preferences.getSettings().setValue("PEP8/HangClosing", False)
         Preferences.getSettings().setValue("PEP8/DocstringType", "pep257")
         Preferences.getSettings().setValue("PEP8/MaxCodeComplexity", 10)

eric ide

mercurial