Closed ruancomelli closed 9 months ago
The rule useless-else-on-loop should NOT trigger in the following snippet, but it does:
useless-else-on-loop
for thing in things: for other_thing in other_things: pass # inner body else: break else: explode_computer()
rewriting it as
for thing in things: for other_thing in other_things: pass # inner body else: break explode_computer()
Sourcery Version: 1.8.0
A user reported this bug to our e-mail support.
Additionally, the message "If else clause is always executed move code to same level as loop" is wrong.
This was fixed by v1.10.0.
Checklist
Description
The rule
useless-else-on-loop
should NOT trigger in the following snippet, but it does:rewriting it as
Debug Information
Sourcery Version: 1.8.0
Additional Information
A user reported this bug to our e-mail support.