84 ), |
84 ), |
85 "Y122": QCoreApplication.translate( |
85 "Y122": QCoreApplication.translate( |
86 "SimplifyChecker", '''Use "{0}.get({1})" instead of "if {1} in {0}: {0}[{1}]"''' |
86 "SimplifyChecker", '''Use "{0}.get({1})" instead of "if {1} in {0}: {0}[{1}]"''' |
87 ), |
87 ), |
88 "Y123": QCoreApplication.translate( |
88 "Y123": QCoreApplication.translate( |
89 "SimplifyChecker", '''Use "{0} = {1}.get({2}, {3})" instead of an if-block''' |
89 "SimplifyChecker", """Use "{0} = {1}.get({2}, {3})" instead of an if-block""" |
90 ), |
90 ), |
91 # Python-specifics not part of flake8-simplify |
91 # Python-specifics not part of flake8-simplify |
92 "Y181": QCoreApplication.translate( |
92 "Y181": QCoreApplication.translate( |
93 "SimplifyChecker", '''Use "{0}" instead of "{1}"''' |
93 "SimplifyChecker", '''Use "{0}" instead of "{1}"''' |
94 ), |
94 ), |
152 "SimplifyChecker", """Use keyword-argument instead of magic boolean""" |
152 "SimplifyChecker", """Use keyword-argument instead of magic boolean""" |
153 ), |
153 ), |
154 "Y402": QCoreApplication.translate( |
154 "Y402": QCoreApplication.translate( |
155 "SimplifyChecker", """Use keyword-argument instead of magic number""" |
155 "SimplifyChecker", """Use keyword-argument instead of magic number""" |
156 ), |
156 ), |
157 |
|
158 "Y901": QCoreApplication.translate( |
157 "Y901": QCoreApplication.translate( |
159 "SimplifyChecker", '''Use "{0}" instead of "{1}"''' |
158 "SimplifyChecker", '''Use "{0}" instead of "{1}"''' |
160 ), |
159 ), |
161 "Y904": QCoreApplication.translate( |
160 "Y904": QCoreApplication.translate( |
162 "SimplifyChecker", """Initialize dictionary "{0}" directly""" |
161 "SimplifyChecker", """Initialize dictionary "{0}" directly""" |
215 "Y221": ["foo"], |
214 "Y221": ["foo"], |
216 "Y222": ["foo"], |
215 "Y222": ["foo"], |
217 # Opinionated |
216 # Opinionated |
218 "Y301": ["42", "foo"], |
217 "Y301": ["42", "foo"], |
219 # General Code Style |
218 # General Code Style |
220 |
|
221 # Additional checks |
219 # Additional checks |
222 "Y901": ["foo == bar", "bool(foo == bar)"], |
220 "Y901": ["foo == bar", "bool(foo == bar)"], |
223 "Y904": ["foo"], |
221 "Y904": ["foo"], |
224 "Y905": [ |
222 "Y905": [ |
225 """["de", "com", "net", "org"]""", """domains = "de com net org".split()""" |
223 """["de", "com", "net", "org"]""", |
|
224 """domains = "de com net org".split()""", |
226 ], |
225 ], |
227 "Y906": ["os.path.join(a, b, c)", "os.path.join(a,os.path.join(b,c))"], |
226 "Y906": ["os.path.join(a, b, c)", "os.path.join(a,os.path.join(b,c))"], |
228 "Y907": ["int", "Union[int, None]"], |
227 "Y907": ["int", "Union[int, None]"], |
229 "Y909": ["foo = foo"], |
228 "Y909": ["foo = foo"], |
230 } |
229 } |