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

Issue 1958 - Else block detected as useless incase of loop breaks #1962

Merged
merged 4 commits into from
Apr 1, 2021
Merged

Issue 1958 - Else block detected as useless incase of loop breaks #1962

merged 4 commits into from
Apr 1, 2021

Conversation

cyber1998
Copy link
Contributor

@cyber1998 cyber1998 commented Mar 31, 2021

After merging this PR, we expect the else block in while..else and for..else statements to be considered as correct instead of being marked as useless if the loop has a break statement

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made
  • [] I have added my changes to the 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.

@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #1962 (c4a434d) into master (e535aed) will not change coverage.
The diff coverage is n/a.

❗ Current head c4a434d differs from pull request most recent head 33f91c3. Consider uploading reports for the commit 33f91c3 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1962   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          118       118           
  Lines         6208      6208           
  Branches      1382      1382           
=========================================
  Hits          6208      6208           
Impacted Files Coverage Δ
...emake_python_styleguide/visitors/ast/conditions.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e535aed...33f91c3. Read the comment docs.

@cyber1998 cyber1998 changed the title Issue 1958 Issue 1958 - Else block detected as useless incase of loop breaks Mar 31, 2021
@cyber1998
Copy link
Contributor Author

Can someone please help me with the change that's needed to be done on the CHANGELOG.md file with respect to this particular change in my PR? If anyone could even point me towards the right direction that would be awesome.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍
Thanks!

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@cyber1998 cyber1998 marked this pull request as ready for review April 1, 2021 03:15
@cyber1998
Copy link
Contributor Author

cyber1998 commented Apr 1, 2021

Thanks for the suggestion @sobolevn, updated my PR. 👍

Do I need to make any changes to the CHANGELOG.md file? There was a checkbox for it on the PR template.
Otherwise, ready for approval.

@sobolevn
Copy link
Member

sobolevn commented Apr 1, 2021

Thanks a lot! 👍

@sobolevn sobolevn merged commit 2db0c88 into wemake-services:master Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WPS503 on for ... else
2 participants