Skip to content

Commit

Permalink
ruff: attempt to enable ARG checks, suppress in some places
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Aug 28, 2024
1 parent 8b1ec35 commit a751f2b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion my/core/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
parametrize = pytest.mark.parametrize
else:

def parametrize(*args, **kwargs):
def parametrize(*_args, **_kwargs):
def wrapper(f):
return f

Expand Down
6 changes: 3 additions & 3 deletions my/core/utils/itertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -162,7 +162,7 @@ def wit():
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
Expand Down
2 changes: 1 addition & 1 deletion my/pdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
4 changes: 2 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ lint.extend-select = [
"PLR", # 'refactor' rules
"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
# "DTZ", # datetimes checks -- complaining about missing tz and mostly false positives
]
Expand Down

0 comments on commit a751f2b

Please sign in to comment.