Skip to content

# noqa is not working properly (or I missed sth?) #64

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

Closed
asottile opened this issue Apr 3, 2021 · 5 comments
Closed

# noqa is not working properly (or I missed sth?) #64

asottile opened this issue Apr 3, 2021 · 5 comments

Comments

@asottile
Copy link
Member

asottile commented Apr 3, 2021

In GitLab by @kreb on Jan 5, 2015, 04:07

Here is a simple py file with such code:

DEF_TOKENS = {                              # noqa
    # token                   is reqired?   # noqa
    'reportSchema'              : True      # noqa
}                                           # noqa

and a result of flake8 validation:

flake8 /home/prj/foo
/home/prj/foo/bar.py:4:32: E203 whitespace before ':'

Process finished with exit code 1

Hmm... seems to be an error - # noqa is not working in this case as documentation claims :(

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Jan 5, 2015, 05:54

The documentation is vague about this. # noqa will not ignore the particularly strenuous recommendations of pep8.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @kreb on Jan 5, 2015, 06:26

So I find it as a big issue - I'd like to have such dictionary definition styled as a table with columns (and yes - I don't care PEP8 in this case, code readability is more important than styling) but flake8 forbids me to do it or forces me using # flake8: noqua so I loose possibility for validation of the rest of file.

Please fix it in next release...

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Jan 5, 2015, 06:47

That doesn't fit within the project's plans. We will not be fixing this in the next release.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @spookylukey on Aug 26, 2015, 06:12

I created a plugin to do this: https://github.com/spookylukey/flake8-respect-noqa

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Mar 28, 2016, 14:22

mentioned in merge request !57

@asottile asottile closed this as completed Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant