tweekmonster / impsort.vim

Sort and highlight Python imports in Vim
MIT License
37 stars 6 forks source link

Respect inline comments #8

Closed tweekmonster closed 7 years ago

tweekmonster commented 8 years ago

Comments are discarded when parsing imports, particularly # noqa. They should be preserved or the import line should be ignored completely.

tweekmonster commented 8 years ago

I think this is addressed in 14b0276bd7c0bafdb290c3399821fe9da2789220 but has potential to be weird:

import moduleA, moduleB  # noqa

is sorted to

import moduleA  # noqa
import moduleB  # noqa

Which I think is fine. But,

from module import moduleA  # noqa
from module import moduleB

is sorted to

from module import moduleA, moduleB  # noqa

Which is not fine.