Open wwuck opened 3 days ago
Related: RSE102 Unnecessary parentheses on raised exception [unnecessary-paren-on-raise-exception]
Related: RSE102
Unnecessary parentheses on raised exception [unnecessary-paren-on-raise-exception]
This is a great note. We would have to merge RSE102
and EM104
to avoid introducing conflicting rules, but that's difficult because RSE102
applies to all exceptions where EM104
applies only to built-in exceptions, unless we extend its scope. This needs some design and a decision.
Newbie Q: is EM104 redundant with EM105 though?
Also, what about checking for any stdlib exception, even if not a builtin in this sense? The original feature request argument (that is, ease of debugging and log file informativeness) applies if an exception has an unspecific name, or can be raised in very many places. I don't know if stdlib non-builtin exceptions do exist after PEP 3151, though.
Newbie Q: is EM104 redundant with EM105 though?
I consider EM104 a less opinionated version of EM105. Having the rules separate allows some users to only opt in to the stylistic EM104 without requiring an exception message. But yes, the rule is redundant if both EM104 and EM105 are enabled. This is a great point.
I would like to request adding two new checks from flake8-errmsg that have been added since the original checks were added to ruff.
https://github.com/henryiii/flake8-errmsg/pull/23
Example
test.py
: