flake8-raise
flake8-raise copied to clipboard
[feature request] Missing parentheses on raised exception
I would like to propose another check.
R103 Missing parentheses on raised exception
It would be off by default, but could be activated for projects that want to follow convention with having always parentheses (see google style docs).
if something:
raise PermissionDenied
Will result in the error: R103 Missing parentheses on raised exception
To fix, change to:
if something:
raise PermissionDenied()
By the way, thanks for the plugin :)
As an alternative both R102 and R103 could be ignored by default, as it is done with W503 and W504.