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

branch
eric7
changeset 9277
471c5a263d53
parent 9221
bf71ee032bb4
child 9278
36448ca469c2
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py	Thu Jul 28 14:19:57 2022 +0200
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py	Thu Jul 28 19:44:54 2022 +0200
@@ -85,6 +85,9 @@
     "Y122": QCoreApplication.translate(
         "SimplifyChecker", '''Use "{0}.get({1})" instead of "if {1} in {0}: {0}[{1}]"'''
     ),
+    "Y123": QCoreApplication.translate(
+        "SimplifyChecker", '''Use "{0} = {1}.get({2}, {3})" instead of an if-block'''
+    ),
     # Python-specifics not part of flake8-simplify
     "Y181": QCoreApplication.translate(
         "SimplifyChecker", '''Use "{0}" instead of "{1}"'''
@@ -151,6 +154,25 @@
     "Y402": QCoreApplication.translate(
         "SimplifyChecker", """Use keyword-argument instead of magic number"""
     ),
+    
+    "Y901": QCoreApplication.translate(
+        "SimplifyChecker", '''Use "{0}" instead of "{1}"'''
+    ),
+    "Y904": QCoreApplication.translate(
+        "SimplifyChecker", """Initialize dictionary "{0}" directly"""
+    ),
+    "Y905": QCoreApplication.translate(
+        "SimplifyChecker", '''Use "{0}" instead of "{1}"'''
+    ),
+    "Y906": QCoreApplication.translate(
+        "SimplifyChecker", '''Use "{0}" instead of "{1}"'''
+    ),
+    "Y907": QCoreApplication.translate(
+        "SimplifyChecker", '''Use "Optional[{0}]" instead of "{1}"'''
+    ),
+    "Y909": QCoreApplication.translate(
+        "SimplifyChecker", '''Remove reflexive assignment "{0}"'''
+    ),
 }
 
 _simplifyMessagesSampleArgs = {
@@ -173,6 +195,8 @@
     "Y120": ["Foo"],
     "Y121": ["FooBar", "Foo"],
     "Y122": ["bar_dict", "'foo'"],
+    "Y123": ["foo", "fooDict", "bar", "default"],
+    "Y124": ["foo", "bar"],
     # Python-specifics not part of flake8-simplify
     "Y181": ["foo += 42", "foo = foo + 42"],
     "Y182": ["super()"],
@@ -193,4 +217,14 @@
     # Opinionated
     "Y301": ["42", "foo"],
     # General Code Style
+    
+    # Additional checks
+    "Y901": ["foo == bar", "bool(foo == bar)"],
+    "Y904": ["foo"],
+    "Y905": [
+        """["de", "com", "net", "org"]""", """domains = "de com net org".split()"""
+    ],
+    "Y906": ["os.path.join(a, b, c)", "os.path.join(a,os.path.join(b,c))"],
+    "Y907": ["int", "Union[int, None]"],
+    "Y909": ["foo = foo"],
 }

eric ide

mercurial