eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py

changeset 8211
8322a6f219ff
parent 8210
b5903eaa7a7b
child 8218
7c09585bd960
diff -r b5903eaa7a7b -r 8322a6f219ff eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py	Sat Apr 10 13:02:08 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py	Sat Apr 10 15:11:43 2021 +0200
@@ -44,10 +44,10 @@
         '''Use "{0} in {1}" instead of "{2}"'''),
     "Y110": QCoreApplication.translate(
         "SimplifyChecker",
-        '''Use "return any({0} for {1} in {2})"'''),
+        '''Use "any({0} for {1} in {2})"'''),
     "Y111": QCoreApplication.translate(
         "SimplifyChecker",
-        '''Use "return all({0} for {1} in {2})"'''),
+        '''Use "all({0} for {1} in {2})"'''),
     "Y112": QCoreApplication.translate(
         "SimplifyChecker",
         '''Use "{0}" instead of "{1}"'''),
@@ -79,6 +79,9 @@
     "Y121": QCoreApplication.translate(
         "SimplifyChecker",
         '''Use "class {0}({1}):" instead of "class {0}({1}, object):"'''),
+    "Y122": QCoreApplication.translate(
+        "SimplifyChecker",
+        '''Use "{0}.get({1})" instead of "if {1} in {0}: {0}[{1}]"'''),
     
     # Python-specifics not part of flake8-simplify
     "Y181": QCoreApplication.translate(
@@ -137,9 +140,18 @@
         "SimplifyChecker",
         '''Use "False" instead of "... and False"'''),
     
+    # Opinionated
     "Y301": QCoreApplication.translate(
         "SimplifyChecker",
         '''Use "{1} == {0}" instead of "{0} == {1}" (Yoda-condition)'''),
+    
+    # General Code Style
+    "Y401": QCoreApplication.translate(
+        "SimplifyChecker",
+        '''Use keyword-argument instead of magic boolean'''),
+    "Y402": QCoreApplication.translate(
+        "SimplifyChecker",
+        '''Use keyword-argument instead of magic number'''),
 }
 
 _simplifyMessagesSampleArgs = {
@@ -161,6 +173,7 @@
     "Y119": ["Foo"],
     "Y120": ["Foo"],
     "Y121": ["FooBar", "Foo"],
+    "Y122": ["bar_dict", "'foo'"],
     
     # Python-specifics not part of flake8-simplify
     "Y181": ["foo += 42", "foo = foo + 42"],
@@ -183,5 +196,8 @@
     "Y221": ["foo"],
     "Y222": ["foo"],
     
+    # Opinionated
     "Y301": ["42", "foo"],
+    
+    # General Code Style
 }

eric ide

mercurial