Make superfluous-parens
consider string combinations
#4792
Labels
Enhancement ✨
Improvement to a component
False Negative 🦋
No message is emitted but something is wrong with the code
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Milestone
Current problem
Although #4784 fixes some problems with
superfluous-parens
it still does not consider the following cases:This is because the current checker focuses on unnecessary parens after keywords (
if
,else
, etc.) and only if the(
immediately follows the keyword. Seeon line
373
informat.py
and the fact that we only run when Keywords are present.Ideally, the checker would also consider string combinations and seeing if parens are necessary there.
Desired solution
Raise
superfluous-parens
message on the test cases described above.Additional context
No response
The text was updated successfully, but these errors were encountered: