Skip to content

Autofix for ISC003 #18081

@ktbarrett

Description

@ktbarrett

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"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixesRelated to suggested fixes for violations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions