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

Added 'pep8' stlye without enforcing order within the groups #63

Closed snoack closed 8 years ago

snoack commented 8 years ago

PEP-8 doesn't enforce sorting the imports alphanumerically inside the individual groups, however flake8-import-order currently does. So this PR adds an option to ignore the names for the ordering.

FWIW, I think that option should be enabled by default (it's not yet), as there IMO is no reason to be stricter than PEP-8 by default. But I leave that decision up to you guys.

pgjones commented 8 years ago

@snoack I think this project exists to enforce import ordering beyond pep8, notably the google, cryptography or smarkets style. As all of these styles enforce ordering within the groups I don't think this option should be used with them. Instead I think it would make more sense for you to use flake8-isort or to add a new pep8 style to this project.

snoack commented 8 years ago

add a new pep8 style to this project.

Done, I updated the PR.

pgjones commented 8 years ago

I think you should also add a test case, e.g. https://github.com/public/flake8-import-order/blob/master/tests/test_cases/complete_google.py. Otherwise I think this is good.

snoack commented 8 years ago

Alright, tests have been added.