Skip to content

Commit

Permalink
Enable Ruff ARG (flake8-unsued-arguments) and remove unused arguments (
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Dec 30, 2024
1 parent 432d8db commit ebc9ff8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/ts_utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
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


Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/regr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions tests/stubtest_third_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit ebc9ff8

Please sign in to comment.