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

Trailing added list not autofixed by RUF005 #3496

Closed
Pierre-Sassoulas opened this issue Mar 13, 2023 · 1 comment · Fixed by #4557
Closed

Trailing added list not autofixed by RUF005 #3496

Pierre-Sassoulas opened this issue Mar 13, 2023 · 1 comment · Fixed by #4557
Labels
fixes Related to suggested fixes for violations

Comments

@Pierre-Sassoulas
Copy link
Contributor

In the following snippet called a.py;

import sys
from pathlib import Path
import pytest


@pytest.mark.parametrize(
    "args",
    [
        ["--disable=import-error,unused-import"],
    ],
)
def test_a(self, tmp_path: Path, args: list[str]) -> None:
    for path in ("astroid.py", "hmac.py"):
        pylint_call = [sys.executable, "-m", "pylint"] + args + [path]
        print(pylint_call)

The fix for RUF05 when launched with ruff a.py --fix --select="RUF" is:

pylint_call = [sys.executable, "-m", "pylint", *args] + [path]

Unless I'm mistaken it should be

pylint_call = [sys.executable, "-m", "pylint", *args, path]
@charliermarsh charliermarsh added the fixes Related to suggested fixes for violations label Mar 13, 2023
@Pierre-Sassoulas Pierre-Sassoulas changed the title Trailing list list not autofixed by RUF005 Trailing added list not autofixed by RUF005 Mar 14, 2023
@hoel-bagard
Copy link
Contributor

Hi, I'm looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants