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

fix Imported names order warning with google style #41

Closed iartarisi closed 9 years ago

iartarisi commented 9 years ago

using the following import:

from .models import (
    A,
    C,
    b,
)

I would get this message:

I101 Imported names are in the wrong order. Should be A, C, b

This happened because the comparison that the plugin does is correct (lexicographic, case-insensitive). But when the error message is displayed, only a lexicographic case-sensitive sorting algorithm is used (python's default sorted)

iartarisi commented 9 years ago

Sorry, didn't spend the time to figure out how to add a test case for this. I didn't find any other tests for user messages.

public commented 9 years ago

Yeah there aren't any :( Thanks a lot for this fix. Looks like it should work fine. I'll try and arrange some way of testing the message in future.