Skip to content

CCE001 triggers on dependent attributes #29

@stdedos

Description

@stdedos

Describe the bug

class T:
    _d = "a"
    M = _d
$ flake8 test.py 
Unable to find qualified name for module: test.py
`file_tokens` will be removed in a future version
test.py:1:1: D100 Missing docstring in public module
test.py:1:1: D101 Missing docstring in public class
test.py:2:5: CCE001 T._d should be after T.M
test.py:3:5: VNE001 single letter variable names like 'M' are not allowed

but the fix gives:

$ python3 test.py
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    class T:
  File "test.py", line 2, in T
    M = _d
NameError: name '_d' is not defined

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions