Skip to content

[preview] RUF028 false positive in decorators. #11689

@randolf-scholz

Description

@randolf-scholz

Rule RUF028 produces false positives for decorators:

https://play.ruff.rs/139a4202-caac-4f92-9662-671492adc377

import pytest

@pytest.mark.parametrize(
    "test_input,expected",
     [
          ("3+5",  8 ),
          ("17+2", 19),
     ],
)  # fmt: skip
def test_eval(test_input, expected):
    assert eval(test_input) == expected

The # fmt: skip comment gets flagged as invalid, despite the fact that it does actually work (as one would expect).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions especially welcomelinterRelated to the lintersuppressionRelated to supression of violations e.g. noqa

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions