autopep8 icon indicating copy to clipboard operation
autopep8 copied to clipboard

Is there any tool that autoformats multiple "from" imports according to PEP E401?

Open ioudas opened this issue 2 years ago • 1 comments

I'm surprised that no tool seems to regard this code as bad, since it makes git unnecessary conflicts:

from A import alpha, beta

This will create manual git conflicts for anyone changing the import.

Is there any tool that autoformats above code to:

from A import (alpha,
                beta)

Thanks for any tips

ioudas avatar Feb 14 '23 13:02 ioudas

I wrote reorder-python-imports -- there's also settings for isort to do this

asottile avatar Mar 08 '23 19:03 asottile