ruff: attempt to enable ARG checks, suppress in some places

This commit is contained in:
Dima Gerasimov 2024-08-28 01:51:14 +01:00 committed by karlicoss
parent 72cc8ff3ac
commit 985c0f94e6
4 changed files with 7 additions and 7 deletions

View file

@ -15,7 +15,7 @@ if typing.TYPE_CHECKING or under_pytest:
parametrize = pytest.mark.parametrize
else:
def parametrize(*args, **kwargs):
def parametrize(*_args, **_kwargs):
def wrapper(f):
return f

View file

@ -63,7 +63,7 @@ def test_ensure_unique() -> None:
list(it)
# hacky way to force distinct objects?
list(ensure_unique(dups, key=lambda i: object()))
list(ensure_unique(dups, key=lambda _: object()))
def make_dict(
@ -115,7 +115,7 @@ def _listify(func: Callable[LFP, Iterable[LV]], *args: LFP.args, **kwargs: LFP.k
# so seems easiest to just use specialize instantiations of decorator instead
if TYPE_CHECKING:
def listify(func: Callable[LFP, Iterable[LV]]) -> Callable[LFP, List[LV]]: ...
def listify(func: Callable[LFP, Iterable[LV]]) -> Callable[LFP, List[LV]]: ... # noqa: ARG001
else:
listify = _listify
@ -162,7 +162,7 @@ def _warn_if_empty(func, *args, **kwargs):
if TYPE_CHECKING:
FF = TypeVar('FF', bound=Callable[..., Iterable])
def warn_if_empty(f: FF) -> FF: ...
def warn_if_empty(func: FF) -> FF: ... # noqa: ARG001
else:
warn_if_empty = _warn_if_empty

View file

@ -25,7 +25,7 @@ class config(Protocol):
def paths(self) -> Paths:
return () # allowed to be empty for 'filelist' logic
def is_ignored(self, p: Path) -> bool:
def is_ignored(self, p: Path) -> bool: # noqa: ARG002
"""
You can override this in user config if you want to ignore some files that are tooheavy
"""