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

Name ordering bug #47

Closed reaperhulk closed 8 years ago

reaperhulk commented 9 years ago
from cryptography.x509.oid import (
    _OID_NAMES, OID_AUTHORITY_INFORMATION_ACCESS
    OID_AUTHORITY_KEY_IDENTIFIER

Gives "Imported names are in the wrong order. Should be _OID_NAMES, OID_AUTHORITY_INFORMATION_ACCESS, OID_AUTHORITY_KEY_IDENTIFIER".

Changing the import to

from cryptography.x509.oid import (
    OID_AUTHORITY_INFORMATION_ACCESS
    OID_AUTHORITY_KEY_IDENTIFIER, _OID_NAMES

makes it happy.

There appears to be a similar bug with the output msg and its expected ordering related to capitalization as well, although I don't have an example handy right now. This is with flake8-import-order 0.6.1

untitaker commented 9 years ago

Regression from: https://github.com/public/flake8-import-order/pull/45

Basically that PR duplicated the sorting logic.

pgjones commented 8 years ago

@reaperhulk Is this fixed in 707d07ca1b53c7aa81c020fd56361b0f19303cec, #57? It looks that way to me but I may have missed your point.