Skip to content

Commit

Permalink
Add flake8-unused-arguments to lint (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthrok authored Sep 3, 2024
1 parent 19a3dd2 commit 2af8444
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/image_dataloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def worker_entrypoint(args: list[str]) -> PerfResult:

ev = Event()

def handler_stop_signals(signum, frame):
def handler_stop_signals(_signum, _frame):
ev.set()

signal.signal(signal.SIGTERM, handler_stop_signals)
Expand Down
4 changes: 2 additions & 2 deletions examples/multi_thread_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def run_test(**kwargs):
return data


def _print(data, kwargs):
def _print(data):
for i, (x, y) in enumerate(data.values()):
if i == 0:
print("\t".join(str(v) for v in x))
Expand Down Expand Up @@ -311,7 +311,7 @@ def entrypoint(
for kwargs in argset:
print(kwargs)
data = run_test(root_dir=root_dir, split=split, max_items=max_items, **kwargs)
_print(data, kwargs)
_print(data)


def _parse_args():
Expand Down
2 changes: 1 addition & 1 deletion examples/video_dataloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def worker_entrypoint(args: list[str]) -> PerfResult:

ev = Event()

def handler_stop_signals(signum, frame):
def handler_stop_signals(_signum, _frame):
ev.set()

signal.signal(signal.SIGTERM, handler_stop_signals)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extend-exclude = [

[tool.ruff.lint]
extend-select = [
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"I", # isort
Expand Down
2 changes: 1 addition & 1 deletion src/spdl/dataloader/_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async def _execute_task(self) -> None:
_LG.debug("Starting the task.")

task = create_task(self._coro, name="Pipeline::main")
task.add_done_callback(lambda t: self._task_completed.set())
task.add_done_callback(lambda _: self._task_completed.set())

self._task_started.set()
while not task.done():
Expand Down
2 changes: 1 addition & 1 deletion src/spdl/utils/_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def trace_gc():
"""Attach tracer to garbage collection."""
import gc

def _func(phase, info):
def _func(phase, _info):
if phase == "start":
_libspdl.trace_event_begin("gc")
else:
Expand Down

0 comments on commit 2af8444

Please sign in to comment.