Closed sshishov closed 1 year ago
Thank you for your issue! I agree that this is a controversial case. I'm not sure if it's possible to solve using the rules in the plugin. I would be glad to accept your contributions.
@afonasev I assume we can close this issue as it is something we cannot change... It is the modification of the code causing the issue, not the applier rule.
The same way we can complain if new developer comes and add the line like a = 100 / 0
, therefore let's not overthink and overreact.
Closing as won't fix.
Ok. If needed, you can always disable the R506 rule via the noqa instruction locally or via configuration globally.
Description
The error reported for R506 can be dangerous in fast changing development environment
What I Did
Let assume we have this piece of code
The error reported is the following:
Now let assume we change it according to the proposal, but after short period of time another developer come and changed the code slightly (because IF can be quite big and not intuitive), he removed raise and add the handling of situation inside and removed
try...except
all together. Now let's see the result:As we can see the result is not what the developer expected, but... sometimes it is very difficult to notice such issues. As
elif
has SOME MEANING behind, usually...