Closed MartinThoma closed 3 years ago
Rules for reducing the usage of "not" should not be applied if an exception is raised if the condition applies.
The pattern usually is:
if not condition: raise Exception("condition is not fulfilled but needs to be")
if not (minimum < maximum): raise ValueError(f"minimum={minimum} needs to be smaller than maximum={maximum}")
Blocked by https://github.com/MartinThoma/flake8-simplify/issues/21
Desired change
Rules for reducing the usage of "not" should not be applied if an exception is raised if the condition applies.
Explanation
The pattern usually is:
Example