Description
Current problem
Internally, we have enabled the --check-str-concat-over-line-jumps
option for implicit-str-concat
. But we also allow wrapping implicitly concatenated strings in parenthesis. This is done by our internal patch to Pylint ~3 years ago.
Example code:
a = [
"aa bb"
"cc dd",
]
It raises implicit-str-concat
on the "aa bb"
line, that's good to catch bugs of missing commas.
But for long strings that must be put on multiple lines, currently you need to use explicit str concatenations:
a = [
"aaaaaaaa aaaaaaaa "
+ "aaaaaaaa aaaaaaaa ",
]
We think it should also be fine to use implicit str concatenations BUT wrapped inside parenthesis:
a = [
("aaaaaaaa aaaaaaaa "
"aaaaaaaa aaaaaaaa "),
]
Desired solution
Introduce an opt-in option allow-parenthesized-str-concat
. When enabled, allow the use of parenthesis.
Additional context
WDYT? If you agree, I'll send out our patch.