PyCQA / flake8-import-order

Flake8 plugin that checks import order against various Python Style Guides
GNU Lesser General Public License v3.0
278 stars 72 forks source link

Can't use # noqa: I202 #118

Closed andrew-regan closed 7 years ago

andrew-regan commented 7 years ago

I have imports that have comments inline...mostly for PyCharm inspections. Here's a example:

from foo.bar import baz
# noinspection PyUnresolvedReferences
from pyVmomi import vim, vmodl
import zeb

Assume that example is lines 1-4. I get an I202 error on line 3. When I try to ignore it via # noqa: I202 the I202 then moves to line 4. It looks like the only temporary workaround is to add # noqa: I202 to the first import that report I202 and all that follow. This flags no I202's:

from foo.bar import baz
# noinspection PyUnresolvedReferences
from pyVmomi import vim, vmodl  # noqa: I202
import zeb  # noqa: I202
pgjones commented 7 years ago

:(, so many more edge cases than my code provides. I can reproduce, will look into a fix.

pgjones commented 7 years ago

I think master has this fixed, could you confirm?

andrew-regan commented 7 years ago

Confirmed and thanks again!