Skip to content

Autofix for ISC003 #18081

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

Open
ktbarrett opened this issue May 13, 2025 · 1 comment · May be fixed by #18256
Open

Autofix for ISC003 #18081

ktbarrett opened this issue May 13, 2025 · 1 comment · May be fixed by #18256
Labels
fixes Related to suggested fixes for violations

Comments

@ktbarrett
Copy link

Summary

It seems like it would be fairly trivial to implement an autofix for ISC003. No refactoring of the string would be necessary. If adjacent nodes are any type of string literal (normal, format, raw, raw+format) and there is a + joining them, the + can be removed without affecting other lines. This works for strings with mixtures of string literals and non-literals as well.

a = (
    "123" +
    "456"
    + my_string +
    "789"
    + "0"
)

to ...

a = (
    "123"
    "456"
    + my_string +
    "789"
    "0"
)
@MichaReiser MichaReiser added the fixes Related to suggested fixes for violations label May 14, 2025
@maxmynter
Copy link
Contributor

On it :)

@maxmynter maxmynter linked a pull request May 22, 2025 that will close this issue
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