diff --git a/test-requirements.txt b/test-requirements.txt index 81782eaa7..2b6352da3 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ pep8==1.4.5 pyflakes==0.7.2 flake8==2.0 -hacking>=0.5.3,<0.6 +hacking>=0.8.0,<0.9 # Testing Requirements coverage>=3.6 django-nose diff --git a/tox.ini b/tox.ini index 06bb358b1..f1f3c3137 100644 --- a/tox.ini +++ b/tox.ini @@ -31,4 +31,23 @@ downloadcache = ~/cache/pip [flake8] builtins = _ -exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py +exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg, + build,panel_template,dash_template,local_settings.py + +[hacking] +import_exceptions = collections.defaultdict, + django.conf.settings, + django.core.urlresolvers.reverse, + django.core.urlresolvers.reverse_lazy, + django.template.loader.render_to_string, + django.utils.datastructures.SortedDict, + django.utils.encoding.force_unicode, + django.utils.html.conditional_escape, + django.utils.html.escape, + django.utils.http.urlencode, + django.utils.safestring.mark_safe, + django.utils.translation.pgettext_lazy, + django.utils.translation.ugettext_lazy, + django.utils.translation.ungettext_lazy, + operator.attrgetter, + StringIO.StringIO diff --git a/tuskar_ui/forms.py b/tuskar_ui/forms.py index 577168fb1..59fe48bf6 100644 --- a/tuskar_ui/forms.py +++ b/tuskar_ui/forms.py @@ -13,7 +13,7 @@ # under the License. from django import forms -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import netaddr diff --git a/tuskar_ui/infrastructure/dashboard.py b/tuskar_ui/infrastructure/dashboard.py index 1627a0696..9bad0c9a1 100644 --- a/tuskar_ui/infrastructure/dashboard.py +++ b/tuskar_ui/infrastructure/dashboard.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/deployment/block_storage/panel.py b/tuskar_ui/infrastructure/deployment/block_storage/panel.py index d021aefd0..2636243ae 100644 --- a/tuskar_ui/infrastructure/deployment/block_storage/panel.py +++ b/tuskar_ui/infrastructure/deployment/block_storage/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/deployment/compute/panel.py b/tuskar_ui/infrastructure/deployment/compute/panel.py index 59491250b..00ecc2015 100644 --- a/tuskar_ui/infrastructure/deployment/compute/panel.py +++ b/tuskar_ui/infrastructure/deployment/compute/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/deployment/controller/panel.py b/tuskar_ui/infrastructure/deployment/controller/panel.py index a1faaab58..d1733f46d 100644 --- a/tuskar_ui/infrastructure/deployment/controller/panel.py +++ b/tuskar_ui/infrastructure/deployment/controller/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/deployment/object_storage/panel.py b/tuskar_ui/infrastructure/deployment/object_storage/panel.py index 9dc7d79ed..4fc369514 100644 --- a/tuskar_ui/infrastructure/deployment/object_storage/panel.py +++ b/tuskar_ui/infrastructure/deployment/object_storage/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/deployment/overview/panel.py b/tuskar_ui/infrastructure/deployment/overview/panel.py index 5bc07abc5..522f4d5ad 100644 --- a/tuskar_ui/infrastructure/deployment/overview/panel.py +++ b/tuskar_ui/infrastructure/deployment/overview/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/nodes/free/panel.py b/tuskar_ui/infrastructure/nodes/free/panel.py index aae0f3014..0794da835 100644 --- a/tuskar_ui/infrastructure/nodes/free/panel.py +++ b/tuskar_ui/infrastructure/nodes/free/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/nodes/free/tables.py b/tuskar_ui/infrastructure/nodes/free/tables.py index e45e309e6..3763bf651 100644 --- a/tuskar_ui/infrastructure/nodes/free/tables.py +++ b/tuskar_ui/infrastructure/nodes/free/tables.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ from tuskar_ui.infrastructure.nodes import tables diff --git a/tuskar_ui/infrastructure/nodes/free/views.py b/tuskar_ui/infrastructure/nodes/free/views.py index 8439f06f2..c5beca3bf 100644 --- a/tuskar_ui/infrastructure/nodes/free/views.py +++ b/tuskar_ui/infrastructure/nodes/free/views.py @@ -13,7 +13,7 @@ # under the License. from django.core import urlresolvers -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tables as horizon_tables diff --git a/tuskar_ui/infrastructure/nodes/overview/panel.py b/tuskar_ui/infrastructure/nodes/overview/panel.py index 07f882bc1..a4bf6e397 100644 --- a/tuskar_ui/infrastructure/nodes/overview/panel.py +++ b/tuskar_ui/infrastructure/nodes/overview/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/nodes/resource/panel.py b/tuskar_ui/infrastructure/nodes/resource/panel.py index 39b839760..cb66b3cb2 100644 --- a/tuskar_ui/infrastructure/nodes/resource/panel.py +++ b/tuskar_ui/infrastructure/nodes/resource/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/infrastructure/nodes/resource/tables.py b/tuskar_ui/infrastructure/nodes/resource/tables.py index 4465758c3..a7e13269b 100644 --- a/tuskar_ui/infrastructure/nodes/resource/tables.py +++ b/tuskar_ui/infrastructure/nodes/resource/tables.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ from tuskar_ui.infrastructure.nodes import tables diff --git a/tuskar_ui/infrastructure/nodes/resource/views.py b/tuskar_ui/infrastructure/nodes/resource/views.py index a9ff2cb16..7376eb1db 100644 --- a/tuskar_ui/infrastructure/nodes/resource/views.py +++ b/tuskar_ui/infrastructure/nodes/resource/views.py @@ -13,7 +13,7 @@ # under the License. from django.core import urlresolvers -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tables as horizon_tables diff --git a/tuskar_ui/infrastructure/nodes/tables.py b/tuskar_ui/infrastructure/nodes/tables.py index 67e6950e8..caf36ecfc 100644 --- a/tuskar_ui/infrastructure/nodes/tables.py +++ b/tuskar_ui/infrastructure/nodes/tables.py @@ -13,7 +13,7 @@ # under the License. from django.template import defaultfilters as filters -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ from horizon import tables diff --git a/tuskar_ui/infrastructure/overview/panel.py b/tuskar_ui/infrastructure/overview/panel.py index cd20476f8..b620e5418 100644 --- a/tuskar_ui/infrastructure/overview/panel.py +++ b/tuskar_ui/infrastructure/overview/panel.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ import horizon diff --git a/tuskar_ui/test/settings.py b/tuskar_ui/test/settings.py index 2d44d43fc..5a1f9a71f 100644 --- a/tuskar_ui/test/settings.py +++ b/tuskar_ui/test/settings.py @@ -14,7 +14,7 @@ import os -from django.utils.translation import ugettext_lazy as _ # noqa +from django.utils.translation import ugettext_lazy as _ from horizon.test.settings import * # noqa from horizon.utils import secret_key as secret_key_utils