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 parametrize = pytest.mark.parametrize
else: else:
def parametrize(*args, **kwargs): def parametrize(*_args, **_kwargs):
def wrapper(f): def wrapper(f):
return f return f

View file

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

View file

@ -25,7 +25,7 @@ class config(Protocol):
def paths(self) -> Paths: def paths(self) -> Paths:
return () # allowed to be empty for 'filelist' logic 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 You can override this in user config if you want to ignore some files that are tooheavy
""" """

View file

@ -10,8 +10,8 @@ lint.extend-select = [
"PLR", # 'refactor' rules "PLR", # 'refactor' rules
"B", # 'bugbear' set -- various possible bugs "B", # 'bugbear' set -- various possible bugs
# "FA", # TODO enable later after we make sure cachew works?
# "ARG", # TODO useful, but results in some false positives in pytest fixtures... maybe later
# "S", # bandit (security checks) -- tends to be not very useful, lots of nitpicks # "S", # bandit (security checks) -- tends to be not very useful, lots of nitpicks
# "DTZ", # datetimes checks -- complaining about missing tz and mostly false positives # "DTZ", # datetimes checks -- complaining about missing tz and mostly false positives
] ]