Enable Ruff ARG (flake8-unsued-arguments) and remove unused arguments (#13334)

This commit is contained in:
Avasam
2024-12-29 20:21:19 -05:00
committed by GitHub
parent 432d8db627
commit ebc9ff8718
4 changed files with 7 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ try:
from termcolor import colored as colored # pyright: ignore[reportAssignmentType]
except ImportError:
def colored(text: str, color: str | None = None, **kwargs: Any) -> str: # type: ignore[misc]
def colored(text: str, color: str | None = None, **kwargs: Any) -> str: # type: ignore[misc] # noqa: ARG001
return text

View File

@@ -37,6 +37,7 @@ exclude = ["**/test_cases/**/*.py"]
# tell ruff not to flag these as e.g. "unused noqa comments"
external = ["F821", "NQA", "Y"]
select = [
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"FA", # flake8-future-annotations
"I", # isort

View File

@@ -237,7 +237,7 @@ class Result:
test_case_dir: Path
tempdir: Path
def print_description(self, *, verbosity: Verbosity) -> None:
def print_description(self) -> None:
if self.code:
print(f"{self.command_run}:", end=" ")
print_error("FAILURE\n")
@@ -382,7 +382,7 @@ def main() -> ReturnCode:
print()
for result in results:
result.print_description(verbosity=verbosity)
result.print_description()
code = max(result.code for result in results)

View File

@@ -140,7 +140,7 @@ def run_stubtest(
print_divider()
print("Commands run:")
print_commands(dist, pip_cmd, stubtest_cmd, mypypath)
print_commands(pip_cmd, stubtest_cmd, mypypath)
print_divider()
print("Command output:\n")
@@ -183,7 +183,7 @@ def run_stubtest(
rmtree(venv_dir)
if verbose:
print_commands(dist, pip_cmd, stubtest_cmd, mypypath)
print_commands(pip_cmd, stubtest_cmd, mypypath)
return True
@@ -358,7 +358,7 @@ def setup_uwsgi_stubtest_command(dist: Path, venv_dir: Path, stubtest_cmd: list[
return True
def print_commands(dist: Path, pip_cmd: list[str], stubtest_cmd: list[str], mypypath: str) -> None:
def print_commands(pip_cmd: list[str], stubtest_cmd: list[str], mypypath: str) -> None:
print()
print(" ".join(pip_cmd))
print(f"MYPYPATH={mypypath}", " ".join(stubtest_cmd))