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

UP031 doesn't detect % on new line #3943

Closed
aslomoi opened this issue Apr 12, 2023 · 2 comments · Fixed by #3953
Closed

UP031 doesn't detect % on new line #3943

aslomoi opened this issue Apr 12, 2023 · 2 comments · Fixed by #3953
Labels
bug Something isn't working

Comments

@aslomoi
Copy link

aslomoi commented Apr 12, 2023

👋

ruff 0.0.261

pyproject.toml

[tool.ruff]

select = [
    "UP"
]

Example:

var1 = "var 1"
var2 = "var 2"
print("this will be caught by UP031 with the variables: %s, %s" % (var1, var2))
print(
    "this has percent on a new line and will not be caught by UP031 with the variables: %s, %s"
    % (var1, var2)
)

Only the first print statement above results in UP031.
The second one was formatted to split over two lines but doesn't raise UP031.

@charliermarsh
Copy link
Member

I think we don't flag this because we're not yet capable of fixing it. But, we should probably flag it, even if we can't fix it.

@aslomoi
Copy link
Author

aslomoi commented Apr 20, 2023

Thanks for addressing this!

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

Successfully merging a pull request may close this issue.

2 participants