How to configure a linter (e.g. Ruff) to disallow double assignments in single lines in Python?

I'm looking for a way to configure a linter (such as Ruff or another popular Python linter) to disallow double assignments in single lines, like this:

name, position = files.name, pos

Instead, I want the linter to enforce separate assignments on separate lines, like this:

name = files.name
position = pos

However, I still want to allow tuple unpacking, like this:

name, position = extract_details()

Is there a way to configure a linter to achieve this behavior? If so, how can I do it?

Upvotes: 0

Views: 136

Answers (0)

Related Questions