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

Using #noqa and still get: I100 Import statements are in the wrong order. #136

Open
JohnVillalovos opened this issue Dec 14, 2017 · 3 comments

Comments

@JohnVillalovos
Copy link

JohnVillalovos commented Dec 14, 2017

Trying to use latest version of flake8-import-order from PyPi and got the error:

ironic_inspector/test/functional.py:17:1: I100 Import statements are in the wrong order. import contextlib should be before import eventlet

Code here:
https://github.com/openstack/ironic-inspector/blob/b81c14282477266a1302014357da99b565149a09/ironic_inspector/test/functional.py#L14-L17

The eventlet import needs to be first. We have a '#noqa' on that line but getting the error. Any ideas?

Thanks for the plugin! :)

@pgjones
Copy link
Member

pgjones commented Dec 14, 2017

The issue here is that the error is reported on line 17 and hence the # noqa should be silenced there (rather than on line 14). We had a discussion about this in #120 as 0.14.3 onwards changed the behaviour and I thought this (accepting noqa only on the lines reporting the error) would be clearer. With this in mind, do you think it is clear?

@JohnVillalovos
Copy link
Author

Thanks for the work-around/solution. That did fix the issue.

I guess I was thinking I should put it on line 17.

Plus I would think if a line has "# noqa" it would be ignored. As in right now the eventlet line has "# noqa" on it but the check is still paying attention to the fact that there is an "import eventlet" line.

To me the real culprit here is the "import eventlet" line. So maybe it could accept it on both?

After reading the other bug I agree with the other people that the "# noqa" should be on the line that is actually the culprit, which in this case is "import eventlet" in my opinion.

@Dreamsorcerer
Copy link
Contributor

Ignoring errors on another line from where the #noqa is located is no longer possible in flake8. So, this issue can no longer be solved in this project, probably best to close it.
https://gitlab.com/pycqa/flake8/-/issues/638#note_340556082

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

No branches or pull requests

3 participants