I202 errors for multiline imports
philtay opened this issue · comments
philtay commented
The following snippet triggers an I202 error:
from .foo import (
bar,
baz,
)
from .zoo import (
mux,
mox,
)
I think that a blank line should be allowed when a single import spans multiple lines.
Phil Jones commented
Isn't the I202
due to the newline between these two imports in this case? If so (depending on the style you are using) it is likely correct.
philtay commented
Yes, it's the newline between the imports. Look how ugly it is without:
from .foo import (
bar,
baz,
)
from .zoo import (
mux,
mox,
)
from .moo import (
yux,
yox,
)
I think that multiline imports should be allowed to be separated by a newline.
Phil Jones commented
Fair enough, however all the styles in this package expect the newlines to be absent. I think your best bet is to write your own style with the newlines expected or simply ignore the I202
error.