Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading