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

False negatives for N806, N815, N816 #138

Closed
sobolevn opened this issue Mar 8, 2020 · 0 comments · Fixed by #141
Closed

False negatives for N806, N815, N816 #138

sobolevn opened this issue Mar 8, 2020 · 0 comments · Fixed by #141

Comments

@sobolevn
Copy link
Member

sobolevn commented Mar 8, 2020

This code raises 0 violations:

mixedCase: int = 1

def some():
    mixedCase: int = 1

class Test(object):
    mixedCase: int = 1

But, it should raise 3 of them. Let's refactor ast.AnnAssign to be ast.Assign and here they are:

» flake8 ex.py --select=N

ex.py

  1:2      N816  variable 'mixedCase' in global scope should not be mixedCase
  mixedCase = 1
   ^

  4:6      N806  variable 'mixedCase' in function should be lowercase
  mixedCase = 1
   ^

  7:6      N815  variable 'mixedCase' in class scope should not be mixedCase
  mixedCase = 1
   ^

Full list of violations and explanations:
https://wemake-python-stylegui.de/en/0.13.4/pages/usage/violations/

Related: wemake-services/wemake-python-styleguide#1138

@sobolevn sobolevn changed the title False positives for N806, N815, N816 False negatives for N806, N815, N816 Mar 8, 2020
5j9 added a commit to 5j9/pep8-naming that referenced this issue Mar 10, 2020
PEP 526, syntax for variable annotations, has been introduced in
Python 3.6.[1]

[1]: https://www.python.org/dev/peps/pep-0526/

fixes PyCQA#138
5j9 added a commit to 5j9/pep8-naming that referenced this issue Mar 10, 2020
PEP 526, syntax for variable annotations, has been introduced in
Python 3.6.

https://www.python.org/dev/peps/pep-0526/

fixes PyCQA#138
@5j9 5j9 closed this as completed in #141 Mar 11, 2020
5j9 added a commit that referenced this issue Mar 11, 2020
PEP 526, syntax for variable annotations, has been introduced in
Python 3.6.

https://www.python.org/dev/peps/pep-0526/

fixes #138
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 a pull request may close this issue.

1 participant