The plugin supports multiple styles. The style used by the cryptography project from the Python Cryptographic Authority is the default (see example). This style is more strict than the pep8 style, which "only enforces groups without enforcing the order within the groups". For instance, running the check on the current code base returns 399 errors with the default (cryptography) style and 191 with the pep8 style.
Editor plugins
Some documentation should be added about adding the plugin to the text editor to help developers catching up the errors in their text editor.
PEP 8 has some guidelines for organizing the imports. One of the key things is:
This structure eases code reviews and provides some consistency for the code base.
You can read more about the reasoning behind the Python Style Guide (PEP 8) in the section: A Foolish Consistency is the Hobgoblin of Little Minds.
Adding the check in Travis CI
The style checker
flake8-import-order
plugin from the Python Code Quality Authority can be used so that theflake8
check on Travis CI will also check the import style.The plugin supports multiple styles. The style used by the
cryptography
project from the Python Cryptographic Authority is the default (see example). This style is more strict than thepep8
style, which "only enforces groups without enforcing the order within the groups". For instance, running the check on the current code base returns 399 errors with the default (cryptography
) style and 191 with the pep8 style.Editor plugins
Some documentation should be added about adding the plugin to the text editor to help developers catching up the errors in their text editor.