We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following file t.py:
t.py
def str_to_bool(val): if isinstance(val, bool): return val val = val.strip().lower() if val in ("1", "true", "yes"): return True return False
Running pipx run ruff check --isolated --select RET504 t.py gives me:
pipx run ruff check --isolated --select RET504 t.py
t.py:3:16: RET504 Unnecessary variable assignment before `return` statement
So it points at the return val that hasn't assigned anything.
return val
If I set val by hand instead of passing it in as an argument, there is no error.
$ pipx run ruff --version ruff 0.0.261
no pyproject.toml
pyproject.toml
The text was updated successfully, but these errors were encountered:
👍 Definitely a bug.
Sorry, something went wrong.
RET504
charliermarsh
Successfully merging a pull request may close this issue.
Consider the following file
t.py
:Running
pipx run ruff check --isolated --select RET504 t.py
gives me:So it points at the
return val
that hasn't assigned anything.If I set val by hand instead of passing it in as an argument, there is no error.
no
pyproject.toml
The text was updated successfully, but these errors were encountered: