Skip to content

Commit ebc9ff8

Browse files
authored
Enable Ruff ARG (flake8-unsued-arguments) and remove unused arguments (#13334)
1 parent 432d8db commit ebc9ff8

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

lib/ts_utils/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from termcolor import colored as colored # pyright: ignore[reportAssignmentType]
1818
except ImportError:
1919

20-
def colored(text: str, color: str | None = None, **kwargs: Any) -> str: # type: ignore[misc]
20+
def colored(text: str, color: str | None = None, **kwargs: Any) -> str: # type: ignore[misc] # noqa: ARG001
2121
return text
2222

2323

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ exclude = ["**/test_cases/**/*.py"]
3737
# tell ruff not to flag these as e.g. "unused noqa comments"
3838
external = ["F821", "NQA", "Y"]
3939
select = [
40+
"ARG", # flake8-unused-arguments
4041
"B", # flake8-bugbear
4142
"FA", # flake8-future-annotations
4243
"I", # isort

tests/regr_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class Result:
237237
test_case_dir: Path
238238
tempdir: Path
239239

240-
def print_description(self, *, verbosity: Verbosity) -> None:
240+
def print_description(self) -> None:
241241
if self.code:
242242
print(f"{self.command_run}:", end=" ")
243243
print_error("FAILURE\n")
@@ -382,7 +382,7 @@ def main() -> ReturnCode:
382382
print()
383383

384384
for result in results:
385-
result.print_description(verbosity=verbosity)
385+
result.print_description()
386386

387387
code = max(result.code for result in results)
388388

tests/stubtest_third_party.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def run_stubtest(
140140

141141
print_divider()
142142
print("Commands run:")
143-
print_commands(dist, pip_cmd, stubtest_cmd, mypypath)
143+
print_commands(pip_cmd, stubtest_cmd, mypypath)
144144

145145
print_divider()
146146
print("Command output:\n")
@@ -183,7 +183,7 @@ def run_stubtest(
183183
rmtree(venv_dir)
184184

185185
if verbose:
186-
print_commands(dist, pip_cmd, stubtest_cmd, mypypath)
186+
print_commands(pip_cmd, stubtest_cmd, mypypath)
187187

188188
return True
189189

@@ -358,7 +358,7 @@ def setup_uwsgi_stubtest_command(dist: Path, venv_dir: Path, stubtest_cmd: list[
358358
return True
359359

360360

361-
def print_commands(dist: Path, pip_cmd: list[str], stubtest_cmd: list[str], mypypath: str) -> None:
361+
def print_commands(pip_cmd: list[str], stubtest_cmd: list[str], mypypath: str) -> None:
362362
print()
363363
print(" ".join(pip_cmd))
364364
print(f"MYPYPATH={mypypath}", " ".join(stubtest_cmd))

0 commit comments

Comments
 (0)