Pylint should not emit logging-not-lazy
when using explicit string concatenation for the message
#8410
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Bug description
Since there is no difference in byte code whether the string is explicitly concatenated with
+
or not, the logging isn't really not lazy.Extra context: the Black formatter will by default wrap long strings in parens with extra indentation:
is reformatted to:
Not all people like the extra indentation level, so they could workaround this by using explicit str concatenations:
Above code won't be wrapped. See example: https://black.vercel.app/?version=stable&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4AGJAJZdAD2IimZxl1N_Wl9XMO7It8_a9_zDM7vdFRRO_5rVL_TbaRMZFsldltUpcVRrU3ciQwYZYh1fEUKKhGKajA7blNBzUd1tD9xf20knxX9nUEnMw4r5um_wmnJAbkpayNa6vKQJW31lZlMZ-h8FDJRG0yvSqO-tn_wDhAqHt1M950Ia2LlS8KBt25Oi9a35Qd-DQeQ5aXTpAAAAAJCojbjuFauOAAGyAYoDAAAVp5UpscRn-wIAAAAABFla
But this triggers the
logging-not-lazy
error where it really shouldn't.Configuration
No response
Command used
Pylint output
Expected behavior
It should not raise
logging-not-lazy
Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: