Spoqa's import order style for flake8-import-order
This extends flake8-import-order to implement Spoqa’s import order convention. It bascially follows PEP 8 with our some additional rules:
Standard libraries shouldn’t be imported using from ... import ... statement. It’s because standard libraries tend to use general terms like open. We instead use always qualified imports to eliminate name pollution:
import sys # Yes from sys import version_info # No
However, there are few exceptions like typing module. They can be imported in both ways:
import typing from typing import Optional # `from ... import ...` must be latter
All other than standard libraries should be imported using from ... import ... statement:
from flask import Flask # Yes import flask # No
Deeper relative imports should go former. This rule makes consistent even when relative imports are rewritten as absolute imports.
from ..deeper import former from ...deepest import later
Imported names are splited to three categories: CONSTANT_NAME, ClassName, and normal_names, and follow that order:
from something import CONST_A, CONST_B, ClassA, ClassB, any_func, any_var
[flake8] import-order-style = spoqa
Released on July 15, 2017.
- Fixed a bug that wrong order of names (e.g. from ... import second, first) had been not warned.
Initial release. Released on February 12, 2017.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|flake8_import_order_spoqa-1.0.1-py2.py3-none-any.whl (6.9 kB) Copy SHA256 Checksum SHA256||3.6||Wheel||Jul 15, 2017|
|flake8-import-order-spoqa-1.0.1.tar.gz (4.4 kB) Copy SHA256 Checksum SHA256||–||Source||Jul 15, 2017|