Skip to content

WPS617 false positive with keyword args #3596

@sobolevn

Description

@sobolevn
self._media_by_precedence = sorted(
    (
        media_type
        for parser in self._parsers.values()
        if (media_type := MediaType(parser.content_type)).quality != 0
    ),
    key=lambda media: (media.specificity, media.quality),  # noqa: WPS617
    reverse=True,
)

It says:

django_modern_rest/negotiation.py

  52:17    WPS617 Found lambda assigned as an attribute
  key=lambda media: (media.specificity, media.quality),
      ^

Which is clearly a bug, it is a named param, not an attribute.
PRs are welcome, this is easy to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueEntrypoint to the projecthelp wantedExtra attention is neededlevel:starterGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions