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

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
diff -r 0b936ff1bbb9 -r a2bc06a54d9d src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Sun Nov 06 11:22:39 2022 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Mon Nov 07 17:19:58 2022 +0100
@@ -15,6 +15,7 @@
 
 import pycodestyle
 
+from CodeStyleFixer import CodeStyleFixer
 from Complexity.ComplexityChecker import ComplexityChecker
 from DocStyle.DocStyleChecker import DocStyleChecker
 from Imports.ImportsChecker import ImportsChecker
@@ -390,10 +391,8 @@
 
     stats = {}
 
-    if fixIssues:
-        from CodeStyleFixer import CodeStyleFixer
-
-        fixer = CodeStyleFixer(
+    fixer = (
+        CodeStyleFixer(
             filename,
             source,
             fixCodes,
@@ -404,9 +403,9 @@
             eol,
             backup,
         )
-        # always fix in place
-    else:
-        fixer = None
+        if fixIssues
+        else None
+    )
 
     if not errors:
         if includeMessages:
@@ -484,7 +483,9 @@
             if sys.version_info >= (3, 8, 0):
                 # annotations with type comments are supported from
                 # Python 3.8 on
-                from Annotations.AnnotationsChecker import AnnotationsChecker
+                from Annotations.AnnotationsChecker import (  # __IGNORE_WARNING_I10__
+                    AnnotationsChecker,
+                )
 
                 annotationsChecker = AnnotationsChecker(
                     source,

eric ide

mercurial