Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Adjust Rule] SIM111 - Detect if another statement comes after the loop #62

Closed
kasium opened this issue Jun 14, 2021 · 1 comment · Fixed by #124
Closed

[Adjust Rule] SIM111 - Detect if another statement comes after the loop #62

kasium opened this issue Jun 14, 2021 · 1 comment · Fixed by #124
Assignees
Labels
enhancement New feature or request

Comments

@kasium
Copy link

kasium commented Jun 14, 2021

Desired change

  • Rule(s): SIM111
  • Adjustment: Detect if another statement comes after the loop

Explanation

The below code is flagged with SIM111, but if I would would use the suggested code, the call_method call would be lost.

Example

for a in my_list:
  if a == 2:
    return False
call_method()
return True
@kasium kasium added the enhancement New feature or request label Jun 14, 2021
MartinThoma added a commit that referenced this issue Mar 28, 2022
MartinThoma added a commit that referenced this issue Mar 28, 2022
@MartinThoma
Copy link
Owner

Sorry that this took so long. I'll make a release with this fix today 🤞

MartinThoma added a commit that referenced this issue Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants