Skip to content

multiple-imports-on-one-line

Pythonstyleno fixdefault: off

Reports an import that names several modules, as in import os, sys.

One import per line gives one line per change in a diff, and a merge conflict or a removed import touches one line.

To fix, write one import per module.

Reported
import os, sys
import os
import os.path as p, re
from a import b, c
python:
lint:
rules:
multiple-imports-on-one-line: warn # off (default), warn, error

Suppress one line with sudsy-disable-next-line multiple-imports-on-one-line 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 E401 full