-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Issue 1958 - Else block detected as useless incase of loop breaks #1962
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1962 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 118 118
Lines 6208 6208
Branches 1382 1382
=========================================
Hits 6208 6208
Continue to review full report at Codecov.
|
Can someone please help me with the change that's needed to be done on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
Thanks!
tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_loop_else.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Thanks for the suggestion @sobolevn, updated my PR. 👍 Do I need to make any changes to the |
Thanks a lot! 👍 |
After merging this PR, we expect the
else
block inwhile..else
andfor..else
statements to be considered as correct instead of being marked as useless if the loop has abreak
statementChecklist
CHANGELOG.md
Related issues
Closes #1958
🙏 Please, if you or your company is finding wemake-python-styleguide valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/wemake-python-styleguide. As a thank you, your profile/company logo will be added to our main README which receives hundreds of unique visitors per day.