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

[#271] Restricted variable names with more than one consecutive underscore #277

Merged
merged 8 commits into from
Oct 26, 2018

Conversation

Roxe322
Copy link
Contributor

@Roxe322 Roxe322 commented Oct 19, 2018

I have made things!

Checklist

  • [V] I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • [V] I have created at least one test case for the changes I have made
  • [V] I have updated the documentation for the changes I have made
  • [V] I have added my changes to the CHANGELOG.md

Related issues

@Roxe322
Copy link
Contributor Author

Roxe322 commented Oct 19, 2018

@sobolevn I'm really not sure that I've made some right things. First is moving logics/variable to module (just logics of files in this module) and second is my test (new file and breaking DRY in it). Please, help me with solving it, because I'm really afraid that my decisions in this was wrong

@coveralls
Copy link

Pull Request Test Coverage Report for Build 532

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

Totals Coverage Status
Change from base Build 530: 0.0%
Covered Lines: 1408
Relevant Lines: 1408

💛 - Coveralls

@coveralls
Copy link

coveralls commented Oct 19, 2018

Pull Request Test Coverage Report for Build 573

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

Totals Coverage Status
Change from base Build 571: 0.0%
Covered Lines: 1469
Relevant Lines: 1469

💛 - Coveralls

@Roxe322 Roxe322 changed the title [#271] Restricted variable names with more than one concecutive underscore [#271] Restricted variable names with more than one consecutive underscore Oct 19, 2018
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.

I like the pattern that you have found in this file to split in half.
But, I dislike the way you have named new files.

Module name that contains helpers is an anti-pattern.
And this is not a joke, we actually have a rule to check it: https://github.com/wemake-services/wemake-python-styleguide/blob/master/wemake_python_styleguide/constants.py#L128

So, I suggest to rename name_checks into naming and name_helpers into name_nodes.
How does that sound to you?

Btw, thanks for the awesome job you have done to implement this feature.

@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
import ast
Copy link
Member

Choose a reason for hiding this comment

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

Missing empty line after # -*-

# Correct:
some_value = 5
__magic__ = 5
# Wrong:
Copy link
Member

Choose a reason for hiding this comment

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

There should be an empty line here

This naming rule already exist for module names.

Example::
# Correct:
Copy link
Member

Choose a reason for hiding this comment

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

There should be an empty line here before # Correct:

__magic__ = 5
# Wrong:
some__value = 5
Note:
Copy link
Member

Choose a reason for hiding this comment

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

There should be an empty line here before Note:

@sobolevn
Copy link
Member

@Roxe322 considering your thoughts about dry inside the tests.
Yes, this is a problem. But, we are going to solve it separately.

@Roxe322
Copy link
Contributor Author

Roxe322 commented Oct 21, 2018

Hi, @sobolevn , I've fixed missing blank lines and renamed modules as you suggested. What should I do with DRY problem in tests? Also, I've just noticed that Travis broke in 3.7 tests. Why such problem occured and why in 3.6 everything is ok? I'm using 3.7 on my local machine and pytest working normally.

@sobolevn
Copy link
Member

You have the same problem as #280

I am not sure what happens here.

@vsmaxim
Copy link
Contributor

vsmaxim commented Oct 21, 2018

Hi, @Roxe322, travis ci is failing due to wrong tests. For more info check this: #283.

@Roxe322
Copy link
Contributor Author

Roxe322 commented Oct 22, 2018

Thank you, @vsmaxim. I'll wait @sobolevn to merge your PR, than pull it and update mine :)

@sobolevn
Copy link
Member

@Roxe322 can you please .. versionadded:: 0.3.0 to you violation docs? And then I will merge it.

@Roxe322
Copy link
Contributor Author

Roxe322 commented Oct 26, 2018

@sobolevn Ok, also i'll fix merge conflicts

@sobolevn
Copy link
Member

@Roxe322 please, check your build status.

@Roxe322
Copy link
Contributor Author

Roxe322 commented Oct 26, 2018

@sobolevn Yes, I'm working on this, just not very successful merge conflicts resolving

@sobolevn
Copy link
Member

Awesome! Thanks!

@sobolevn sobolevn merged commit 72958ed into wemake-services:master Oct 26, 2018
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.

None yet

4 participants