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

[Autofix error] RET503 #3126

Closed
hofrob opened this issue Feb 22, 2023 · 1 comment · Fixed by #3141
Closed

[Autofix error] RET503 #3126

hofrob opened this issue Feb 22, 2023 · 1 comment · Fixed by #3141
Assignees
Labels
bug Something isn't working fixes Related to suggested fixes for violations

Comments

@hofrob
Copy link

hofrob commented Feb 22, 2023

versions

$ python --version
Python 3.11.2
$ ruff --version
ruff 0.0.251

example

def foo(bar: list[str]) -> str | None:
    for baz in bar:
        match baz:
            case "yo":
                return sub_foo(baz)


def sub_foo(baz: str) -> str:
    return baz

failing command

(there's no pyproject.toml)

$ ruff check -n --fix --select RET503 .

error: Autofix introduced a syntax error. Reverting all changes.

This indicates a bug in `ruff`. If you could open an issue at:

    https://github.com/charliermarsh/ruff/issues/new?title=%5BAutofix%20error%5D

...quoting the contents of `foo.py`, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!

foo.py:2:5: RET503 Missing explicit `return` at the end of function able to return non-`None` value
Found 1 error.
@charliermarsh charliermarsh added bug Something isn't working fixes Related to suggested fixes for violations labels Feb 22, 2023
@charliermarsh
Copy link
Member

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants