Use flake8-import-order plugin
In reviews we usually check import grouping but it is boring. By using flake8-import-order plugin, we can avoid this. It enforces loose checking so it sounds good to use it. This flake8 plugin is already used in tempest. Note that flake8-import-order version is pinned to avoid unexpected breakage of pep8 job. Setup for unit tests of hacking rules is tweaked to disable flake8-import-order checks. This extension assumes an actual file exists and causes hacking rule unit tests. Change-Id: I61e683ab0119e4ae90b7107f0690528d789e3875
This commit is contained in:
parent
53e55938d9
commit
f4c0468b36
@ -17,6 +17,7 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
|
||||
from cliff import show
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
|
@ -12,9 +12,9 @@
|
||||
#
|
||||
|
||||
import argparse
|
||||
import mock
|
||||
|
||||
from cliff import columns as cliff_columns
|
||||
import mock
|
||||
from osc_lib.tests import utils
|
||||
|
||||
|
||||
|
@ -16,9 +16,10 @@
|
||||
|
||||
import collections
|
||||
import copy
|
||||
import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
|
||||
|
||||
class FakeFWaaS(object):
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
#
|
||||
|
||||
import copy
|
||||
import mock
|
||||
import re
|
||||
|
||||
import mock
|
||||
from osc_lib import exceptions
|
||||
from osc_lib.tests import utils
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
#
|
||||
|
||||
import copy
|
||||
import mock
|
||||
import re
|
||||
|
||||
import mock
|
||||
from osc_lib import exceptions
|
||||
from osc_lib.tests import utils
|
||||
|
||||
|
@ -15,12 +15,12 @@
|
||||
#
|
||||
|
||||
import copy
|
||||
import mock
|
||||
import re
|
||||
import testtools
|
||||
|
||||
import mock
|
||||
from osc_lib import exceptions
|
||||
from osc_lib.tests import utils
|
||||
import testtools
|
||||
|
||||
from neutronclient.osc import utils as osc_utils
|
||||
from neutronclient.osc.v2.fwaas import constants as const
|
||||
|
@ -15,6 +15,7 @@
|
||||
#
|
||||
|
||||
import copy
|
||||
|
||||
import mock
|
||||
|
||||
from neutronclient.osc import utils as nc_osc_utils
|
||||
|
@ -15,9 +15,9 @@
|
||||
#
|
||||
|
||||
import copy
|
||||
import mock
|
||||
import operator
|
||||
|
||||
import mock
|
||||
from osc_lib import exceptions
|
||||
from osc_lib import utils as osc_utils
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
#
|
||||
|
||||
import copy
|
||||
import mock
|
||||
import operator
|
||||
|
||||
import mock
|
||||
from osc_lib import exceptions
|
||||
from osc_lib import utils as osc_utils
|
||||
|
||||
|
@ -11,9 +11,10 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
import mock
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
|
||||
|
||||
class FakeTrunk(object):
|
||||
"""Fake one or more trunks."""
|
||||
|
@ -15,13 +15,13 @@
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
|
||||
import mock
|
||||
from mock import call
|
||||
import testtools
|
||||
|
||||
from osc_lib.cli import format_columns
|
||||
from osc_lib import exceptions
|
||||
from osc_lib.tests import utils as tests_utils
|
||||
import testtools
|
||||
|
||||
from neutronclient.osc.v2.trunk import network_trunk as trunk
|
||||
from neutronclient.osc.v2 import utils as v2_utils
|
||||
|
@ -5,6 +5,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
||||
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
flake8-import-order==0.12 # LGPLv3
|
||||
mox3!=0.19.0,>=0.7.0 # Apache-2.0
|
||||
mock>=2.0 # BSD
|
||||
openstackdocstheme>=1.11.0 # Apache-2.0
|
||||
|
2
tox.ini
2
tox.ini
@ -55,5 +55,7 @@ commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenote
|
||||
[flake8]
|
||||
show-source = true
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools
|
||||
import-order-style = pep8
|
||||
|
||||
# H904: Delay string interpolations at logging calls
|
||||
enable-extensions=H904
|
||||
|
Loading…
x
Reference in New Issue
Block a user