PyCQA / flake8-import-order

Flake8 plugin that checks import order against various Python Style Guides
GNU Lesser General Public License v3.0
278 stars 72 forks source link

Message for error I101 is misleading #44

Closed AndreLouisCaron closed 9 years ago

AndreLouisCaron commented 9 years ago

With version 0.6.1, I get error I101:

from gazpacho.mdp02 import (
    broker,
    echo,
    InvalidCommand,
    Majordomo02Broker,
    Majordomo02Client,
    Majordomo02Worker,
    Reconnect,
    tunnel,
    worker,
)

Here is the error message:

./tests/test_mdp02.py:10:1: I101 Imported names are in the wrong order. Should be broker, echo, InvalidCommand, Majordomo02Broker, Majordomo02Client, Majordomo02Worker, Reconnect, tunnel, worker

I actually copy-pasted the names in the message to make sure they're in the same order as the message says they should be, but I still get the error.

I reorderd them using M-x sort-lines in Emacs, which gave this result and the error no longer appears:

from gazpacho.mdp02 import (
    InvalidCommand,
    Majordomo02Broker,
    Majordomo02Client,
    Majordomo02Worker,
    Reconnect,
    broker,
    echo,
    tunnel,
    worker,
)

According to issue #40, it seems this is indeed the correct order. However, it's quite annoying that the error message suggests the incorrect order :-)