--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py Fri Apr 02 15:35:44 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/translations.py Fri Apr 02 18:13:12 2021 +0200 @@ -34,9 +34,12 @@ "Y107": QCoreApplication.translate( "SimplifyChecker", '''Don't use return in try/except and finally'''), - "Y108": QCoreApplication.translate( + "Y108a": QCoreApplication.translate( "SimplifyChecker", - '''Use ternary operator "{0} = {1} if {2} else {3}"''' + '''Use ternary operator instead of if-else-block'''), + "Y108b": QCoreApplication.translate( + "SimplifyChecker", + '''Use ternary operator "{0} = {1} if {2} else {3}" ''' '''instead of if-else-block'''), "Y109": QCoreApplication.translate( "SimplifyChecker", @@ -63,6 +66,15 @@ "SimplifyChecker", '''Use a dictionary lookup instead of 3+ if/elif-statements: ''' '''return {0}'''), + "Y117": QCoreApplication.translate( + "SimplifyChecker", + '''Use "{0}" instead of multiple with statements'''), + "Y118": QCoreApplication.translate( + "SimplifyChecker", + '''Use "{0} in {1}" instead of "{0} in {1}.keys()"'''), + "Y119": QCoreApplication.translate( + "SimplifyChecker", + '''Use a dataclass for "class {0}"'''), } _simplifyMessagesSampleArgs = { @@ -70,12 +82,15 @@ "Y103": ["foo != bar"], "Y104": ["iterable"], "Y105": ["Exception"], - "Y108": ["foo", "bar", "condition", "baz"], + "Y108b": ["foo", "bar", "condition", "baz"], "Y109": ["foo", "[1, 42]", "foo == 1 or foo == 42"], "Y110": ["check", "foo", "iterable"], "Y111": ["check", "foo", "iterable"], "Y112": ["FOO", "foo"], "Y113": ["foo"], "Y114": ["foo > 42", "bar < 42"], - "Y116": ["mapping.get(foo, 42)"] + "Y116": ["mapping.get(foo, 42)"], + "Y117": ["with Foo() as foo, Bar() as bar:"], + "Y118": ["foo", "bar_dict"], + "Y119": ["Foo"] }