Skip to content

# noqa ignored? #924

Closed
Closed
@WarrenWeckesser

Description

@WarrenWeckesser

Here's an example:

import numpy as np


a = np.array([[ 3.0,  1.0, -4.5],
              [-5.1,  1.5,  2.3],
              [ 0.5, -7.7,  7.1]])

pycodestyle reports problems on lines 4 and 6:

$ pycodestyle pycodestyle_array_noqa.py 
pycodestyle_array_noqa.py:4:16: E201 whitespace after '['
pycodestyle_array_noqa.py:6:16: E201 whitespace after '['

I want to ignore those, so I tried

import numpy as np


a = np.array([[ 3.0,  1.0, -4.5],   # noqa
              [-5.1,  1.5,  2.3],   # noqa
              [ 0.5, -7.7,  7.1]])  # noqa

but pycodestyle 2.5.0 seems to ignore those comments. I get the same report when I run pycodestyle on the edited file. Is it possible to get pycodestyle to ignore these whitespace issues?

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