Skip to content

Autofix for ISC003 produces malformed code #19757

@LKajan

Description

@LKajan

Summary

Autofix fix for ISC003 (Explicitly concatenated string should be implicitly concatenated) produces TypeError: 'str' object is not callable in the following situation.

result = "Line1\n" + (
    "Line2\n"
    "Line3"
)

ruff check --fix produces:

result = "Line1\n" (
    "Line2\n"
    "Line3"
)

Which gives a TypeError: 'str' object is not callable error obiously.

Link to playground: https://play.ruff.rs/a9d9ac04-ef00-4ddf-a3a6-9e61fa9f8840

Version

0.12.7

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixesRelated to suggested fixes for violationshelp wantedContributions especially welcome

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions