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

branch
eric7
changeset 11150
73d80859079c
parent 11090
f5f5f5803935
diff -r fc45672fae42 -r 73d80859079c src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Async/AsyncVisitor.py
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Async/AsyncVisitor.py	Thu Feb 27 09:22:15 2025 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Async/AsyncVisitor.py	Thu Feb 27 14:42:39 2025 +0100
@@ -147,7 +147,7 @@
                 and isinstance(inner.func, ast.Name)
                 and inner.func.id == "open"
             ):
-                errorCode = "ASY101"
+                errorCode = "ASY-101"
 
             elif (
                 isinstance(inner, ast.withitem)
@@ -155,7 +155,7 @@
                 and isinstance(inner.context_expr.func, ast.Name)
                 and inner.context_expr.func.id == "open"
             ):
-                errorCode = "ASY103"
+                errorCode = "ASY-103"
                 inner = inner.context_expr
 
             elif isinstance(inner, ast.Call):
@@ -167,9 +167,9 @@
                     "request.urlopen",
                     "urlopen",
                 ):
-                    errorCode = "ASY100"
+                    errorCode = "ASY-100"
                 elif funcName == "time.sleep":
-                    errorCode = "ASY101"
+                    errorCode = "ASY-101"
                 else:
                     match = re.fullmatch(
                         r"(?P<package>{0}|os\.path|os|subprocess|urllib3)\."
@@ -181,7 +181,7 @@
                             match.group("package") in self.HttpPackages
                             and match.group("method") in self.HttpMethods
                         ):
-                            errorCode = "ASY100"
+                            errorCode = "ASY-100"
 
                         elif (
                             match.group("package") == "subprocess"
@@ -190,19 +190,19 @@
                             match.group("package") == "os"
                             and match.group("method") in self.OsWaitMethods
                         ):
-                            errorCode = "ASY101"
+                            errorCode = "ASY-101"
 
                         elif (
                             match.group("package") == "os"
                             and match.group("method") in self.OsProcessMethods
                         ):
-                            errorCode = "ASY102"
+                            errorCode = "ASY-102"
 
                         elif (
                             match.group("package") == "os.path"
                             and match.group("method") in self.OsPathFuncs
                         ):
-                            errorCode = "ASY104"
+                            errorCode = "ASY-104"
 
                         elif (
                             match.group("package") == "httpx"
@@ -211,7 +211,7 @@
                             match.group("package") == "urllib3"
                             and match.group("method") in self.Urllib3DangerousClasses
                         ):
-                            errorCode = "ASY105"
+                            errorCode = "ASY-105"
 
             if errorCode:
                 self.violations.append((inner, errorCode))

eric ide

mercurial