Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions crates/ruff_linter/resources/test/fixtures/refurb/FURB118.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,23 @@ class NotAMethodButHardToDetect:
# without risking false positives elsewhere or introducing complex heuristics
# that users would find surprising and confusing
FOO = sorted([x for x in BAR], key=lambda x: x.baz)

# https://github.com/astral-sh/ruff/issues/19305
import pytest

@pytest.fixture
def my_fixture_with_param(request):
return request.param

@pytest.fixture()
def my_fixture_with_param2(request):
return request.param


# Decorated function (should be ignored)
def custom_decorator(func):
return func

@custom_decorator
def add(x, y):
return x + y
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ pub(crate) fn reimplemented_operator(checker: &Checker, target: &FunctionLike) {
return;
}

// Skip decorated functions
if let FunctionLike::Function(func) = target {
if !func.decorator_list.is_empty() {
return;
}
}

let Some(params) = target.parameters() else {
return;
};
Expand Down
Loading