Skip to content

WPS605 rule does not take into account a @staticmethod decorator #3292

@kekekekule

Description

@kekekekule

What's wrong

Hi! I mentioned, that code like this is being reported by rule WPS605:

class InviteLink:
    ...

    @staticmethod
    def generate_code():
        return uuid.uuid4().hex.upper()
    ...

The doc says:

Methods without arguments are allowed to be defined, but almost impossible to use.

However, this approach is being possible to use. And it's not incorrect (I know there is WPS602 that forbids statismethod, but it's a separate rule).

How it should be

I suppose, there should not be an error.

Flake8 version and plugins

flake8 = "7.1.1"
wemake-python-styleguide = "1.0.0"

pip information

pip 24.0 from ... (python 3.12)

pip freeze is large and under NDA, sorry :(

OS information

Mac OS 15.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueEntrypoint to the projecthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions