From c23d74ce8e9b841c518fd02d159c4e3967a01135 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sat, 19 Aug 2017 07:15:38 +0000 Subject: [PATCH] flake8-import-order: Ensure to place project imports last To ensure project imports are placed after third party import, we need to specify application-import-names. Previously flake8-import-check checks only standard imports or not. Change-Id: I9beb2105f686dc7d9aebfce8e21c5e182698e2fe --- openstack_dashboard/dashboards/project/stacks/tables.py | 3 +-- openstack_dashboard/dashboards/project/stacks/tests.py | 6 ++---- tox.ini | 3 +++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openstack_dashboard/dashboards/project/stacks/tables.py b/openstack_dashboard/dashboards/project/stacks/tables.py index 4de07668..8159b2b5 100644 --- a/openstack_dashboard/dashboards/project/stacks/tables.py +++ b/openstack_dashboard/dashboards/project/stacks/tables.py @@ -16,14 +16,13 @@ from django.template.defaultfilters import title from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy +from heatclient import exc from horizon import exceptions from horizon import messages from horizon import tables from horizon.utils import filters -from heatclient import exc - from openstack_dashboard import api from openstack_dashboard.dashboards.project.stacks import mappings diff --git a/openstack_dashboard/dashboards/project/stacks/tests.py b/openstack_dashboard/dashboards/project/stacks/tests.py index b605d011..d646a51d 100644 --- a/openstack_dashboard/dashboards/project/stacks/tests.py +++ b/openstack_dashboard/dashboards/project/stacks/tests.py @@ -20,18 +20,16 @@ from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings from django.utils import html - +from heatclient.common import template_format as hc_format from mox3.mox import IsA import six -from heatclient.common import template_format as hc_format from openstack_dashboard import api -from openstack_dashboard.test import helpers as test - from openstack_dashboard.dashboards.project.stacks import api as project_api from openstack_dashboard.dashboards.project.stacks import forms from openstack_dashboard.dashboards.project.stacks import mappings from openstack_dashboard.dashboards.project.stacks import tables +from openstack_dashboard.test import helpers as test INDEX_TEMPLATE = 'horizon/common/_data_table_view.html' diff --git a/tox.ini b/tox.ini index 9a030bc6..a7c53bfe 100644 --- a/tox.ini +++ b/tox.ini @@ -143,7 +143,10 @@ ignore = # H904 Delay string interpolations at logging calls enable-extensions=H203,H904 max-complexity = 20 + +# flake8-import-order configurations import-order-style = pep8 +application-import-names = horizon,openstack_dashboard [hacking] local-check-factory = horizon.hacking.checks.factory