Skip to content

E402 wrongly reported after ignored lines #939

@csala

Description

@csala

I have some code that looks like this:

import warnings   # noqa isort:skip
warnings.filterwarnings("ignore")  # noqa isort:skip

import some
import other
import imports

Up to pycodestyle==2.50, the noqa was honored by pycodestyle ignoring the lines as if they did not exist, and therefore not complaining on the imports below.

On 2.6.0, the noqa does not work anymore and I get an E402 error for every import I have after the warnings line.

Is this the expected behavior (could not find any mention of this in the changelogs) or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions