Update style checkers

bring ironic_staging_drivers pep8 checks in line with main ironic:
- update hacking version to the one from g-r
- add import order checks, with the same style
- enable same additional checks from hacking

Only two small violations found, so better to update now while it's
easy.

Change-Id: I12459a1ffdb122f50ce25230e310412f18717ef5
This commit is contained in:
Pavlo Shchelokovskyy 2017-03-17 20:00:18 +00:00
parent 17d8d23a5f
commit 92865503a7
4 changed files with 10 additions and 4 deletions

View File

@ -14,17 +14,16 @@
"""
Test class for AMT Common
"""
import time
from ironic.common import exception as ironic_exception
from ironic.common import utils
from ironic.tests import base
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
import mock
from oslo_concurrency import processutils
from oslo_config import cfg
import time
from ironic_staging_drivers.amt import common as amt_common
from ironic_staging_drivers.amt import resource_uris

View File

@ -685,7 +685,7 @@ class TestAnsibleDeploy(db_base.DbTestCase):
ironic_nodes['ironic_nodes'])
run_playbook_mock.assert_called_once_with(
'test_pl', ironic_nodes, 'test_k', tags=['wait'])
self.assertEqual(None, state)
self.assertIsNone(state)
@mock.patch.object(utils, 'node_power_action', autospec=True)
@mock.patch.object(pxe.PXEBoot, 'clean_up_ramdisk')

View File

@ -2,7 +2,8 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking<0.11,>=0.10.2 # Apache-2.0
hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0
flake8-import-order==0.11 # LGPLv3
coverage>=4.0 # Apache-2.0
doc8 # Apache-2.0

View File

@ -41,6 +41,12 @@ commands = oslo_debug_helper {posargs}
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
# [E129] visually indented line with same indent as next logical line
ignore = E129
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
import-order-style = pep8
max-complexity=17
# [H106] Dont put vim configuration in source files.
# [H203] Use assertIs(Not)None to check for None.
# [H904] Delay string interpolations at logging calls.
enable-extensions=H106,H203,H904