flake8-bugbear icon indicating copy to clipboard operation
flake8-bugbear copied to clipboard

New check which find duplicate except clauses

Open kasium opened this issue 3 years ago • 2 comments

flake8-bugbear already find duplicate exeptions in the same tuple, but across different except's this is not done

Examples:

try:
    pass
except ValueError:
    pass
except ValueError:
    pass
try:
    pass
except (ValueError, TypeError):
    pass
except (ValueError, UnicodeError):
    pass

I'm happy tp contribute this check 😄

kasium avatar Apr 13 '22 07:04 kasium

I guess this is doable, so sure, would accept this. Should be easy to make not noisey.

Please add description to README and add unit tests for the new checks please for it to be accepted.

cooperlees avatar Apr 14 '22 03:04 cooperlees

Thanks for your comment. Let me give it a try

kasium avatar May 16 '22 08:05 kasium

Released in 22.9.11

cooperlees avatar Sep 11 '22 19:09 cooperlees