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

Names that use AnnAssign are not supported #49

Closed
sobolevn opened this issue Mar 8, 2020 · 4 comments · Fixed by #52
Closed

Names that use AnnAssign are not supported #49

sobolevn opened this issue Mar 8, 2020 · 4 comments · Fixed by #52

Comments

@sobolevn
Copy link
Contributor

sobolevn commented Mar 8, 2020

Reproduction:

  1. echo 'list: int = 1' > ex.py
  2. flake8 ex.py

It exists with status code 0.

I expect it to work the same as list = 1 which produces:

» flake8 ex.py 

ex.py

  1:1      A001  "list" is a python builtin and is being shadowed, consider renaming the variable
  list = 1
  ^

The problem is in this line: https://github.com/gforcada/flake8-builtins/blob/master/flake8_builtins.py#L81 Because it does not check ast.AnnAssign

@sobolevn
Copy link
Contributor Author

sobolevn commented Mar 8, 2020

@gforcada
Copy link
Owner

Right, I hope to have the time in the near future, but so far, does not look promising, PR are always welcome 🌈

@sobolevn
Copy link
Contributor Author

@gforcada will do if you promise me to release it after that 🙂

I am building https://github.com/wemake-services/wemake-python-styleguide/milestone/10 and it is going to be released soon. And I want to have this feature on board (I use flake8-builtins as a dependency)

@gforcada
Copy link
Owner

@sobolevn that's a deal then :)

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.

2 participants