Skip to content

implicit-concat-in-collection

Pythonsuspiciousno fixdefault: offpython/ruff

Reports an element of a list, tuple or set that is several string literals one after the other, with no parentheses and no comma.

Python joins adjacent literals into one string. In a collection that is usually a comma that was left out, and the two items silently become one.

To fix, add the comma, or put the parts in parentheses if one string is meant.

Reported
...
pass
x = ["a" "b", "c"]
...
...
python:
lint:
rules:
implicit-concat-in-collection: warn # off (default), warn, error

Enabled by the presets: python/ruff.

Suppress one line with sudsy-disable-next-line implicit-concat-in-collection in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
ruff ISC004 full