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

Added violation for multiline loops #909

Merged
merged 6 commits into from
Oct 24, 2019

Conversation

Ben-Drebing
Copy link
Contributor

I have made things!

Implemented the MultiLineLoopViolation which is produced when the "iterator" section of a for-loop and the "test" section of a while-loop take up multiple lines.

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 #813

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.

Thanks a lot! Great job! Just two minor comments and we are ready to go!

wemake_python_styleguide/violations/consistency.py Outdated Show resolved Hide resolved
wemake_python_styleguide/violations/consistency.py Outdated Show resolved Hide resolved
@Ben-Drebing
Copy link
Contributor Author

Should be all good to go now! You might have noticed I remembered to run flake8 this time :)

@sobolevn
Copy link
Member

@Ben-Drebing can you please fix this issue?

$ make test
mypy wemake_python_styleguide
wemake_python_styleguide/visitors/ast/loops.py:196: error: Argument 1 to "add_violation" of "BaseVisitor" has incompatible type "Type[MultilineLoopViolation]"; expected "BaseViolation"
Found 1 error in 1 file (checked 102 source files)

@coveralls
Copy link

coveralls commented Oct 24, 2019

Pull Request Test Coverage Report for Build 2071

  • 15 of 15 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 2067: 0.0%
Covered Lines: 4765
Relevant Lines: 4765

💛 - Coveralls

@sobolevn sobolevn merged commit 9bb474b into wemake-services:master Oct 24, 2019
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.

Forbid multi-line for and while loops
3 participants