mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00

## Summary Resolves #15925. `N803` now checks for functions instead of parameters. In preview mode, if a method is decorated with `@override` and the current scope is that of a class, it will be ignored. ## Test Plan `cargo nextest run` and `cargo insta test`.
29 lines
428 B
Python
29 lines
428 B
Python
def func(_, a, A):
|
|
return _, a, A
|
|
|
|
|
|
class Class:
|
|
def method(self, _, a, A):
|
|
return _, a, A
|
|
|
|
|
|
def func(_, setUp):
|
|
return _, setUp
|
|
|
|
|
|
from typing import override
|
|
|
|
class Extended(Class):
|
|
@override
|
|
def method(self, _, a, A): ...
|
|
|
|
|
|
@override # Incorrect usage
|
|
def func(_, a, A): ...
|
|
|
|
|
|
func = lambda _, a, A: ...
|
|
|
|
|
|
class Extended(Class):
|
|
method = override(lambda self, _, a, A: ...) # Incorrect usage
|