Skip to content

pycodestyle 2.1.0 incorrectly flags E305 on module-level constants #601

Description

@sirosen

Our build server pulled in the latest this morning, and we saw failures on files which should be valid because of this.

pycodestyle 2.1.0 seems to be matching for E305 on lines with def or class as a prefix, when it should be looking for def and class .

Simple example:

classic_value = 0
default_foo = 1
default_bar = 2

Those second two lines will be flagged for E305 because there isn't enough whitepace after classic_value or default_foo.

Fix should be simple -- make sure that match requires whitespace -- and this needs a testcase too. I'll be fixing my own code to get past the slightly broken validation, then look into submitting a PR if I can figure out this codebase (never made a contribution before).
As always, thanks for great tools!

EDIT: This can be considered a duplicate of #593 . Sorry for not finding that before submitting.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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