Skip to content

False positive missing-override-decorator with ignores on the same line #3368

@sobolevn

Description

@sobolevn

This code in my Django project raises a false-positive error:

    @classproperty
    @override
    def view_is_async(cls) -> bool:  # noqa: N805  # pyright: ignore[reportIncompatibleVariableOverride]  # pyrefly: ignore[bad-override]
        """We already know this in advance, no need to recalculate."""
        # This is a part of the `django.View` API, so it must be there.
        return cls.is_async is True
ERROR Class member `Controller.view_is_async` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
   --> dmr/controller.py:538:9
    |
538 |     def view_is_async(cls) -> bool:  # noqa: N805  # pyright: ignore[reportIncompatibleVariableOverride]  # pyrefly: ignore[bad-ove...
    |         ^^^^^^^^^^^^^
    |

This only happens with 1.0.0 and preset = 'strict'

Link: https://github.com/wemake-services/django-modern-rest/blob/3fc6f921bf1e410fbf836117edb012bcbd763a54/dmr/controller.py#L536-L541

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions