Enable several checks and do not check docs/source/conf.py
* E265 block comment should start with '# ' * H302 import only modules Do not check docs/source/conf.py. The file is imported from the cookiecutter template. Documented why checks are ignored and if they should be enabled in the future. Change-Id: I367064ecaa6d1fd9d918f7ce003303e2db660647
This commit is contained in:
parent
77991e571b
commit
33058cbe8e
novaclient
tox.ini@ -219,7 +219,7 @@ class NovaClientArgumentParser(argparse.ArgumentParser):
|
||||
exits.
|
||||
"""
|
||||
self.print_usage(sys.stderr)
|
||||
#FIXME(lzyeval): if changes occur in argparse.ArgParser._check_value
|
||||
# FIXME(lzyeval): if changes occur in argparse.ArgParser._check_value
|
||||
choose_from = ' (choose from'
|
||||
progparts = self.prog.partition(' ')
|
||||
self.exit(2, _("error: %(errmsg)s\nTry '%(mainp)s help %(subp)s'"
|
||||
@ -360,8 +360,8 @@ class OpenStackComputeShell(object):
|
||||
# thinking usage-list --end is ambiguous; but it
|
||||
# works fine with only --endpoint-type present
|
||||
# Go figure. I'm leaving this here for doc purposes.
|
||||
#parser.add_argument('--endpoint_type',
|
||||
# help=argparse.SUPPRESS)
|
||||
# parser.add_argument('--endpoint_type',
|
||||
# help=argparse.SUPPRESS)
|
||||
|
||||
parser.add_argument('--os-compute-api-version',
|
||||
metavar='<compute-api-ver>',
|
||||
@ -607,7 +607,7 @@ class OpenStackComputeShell(object):
|
||||
must_auth = not (cliutils.isunauthenticated(args.func)
|
||||
or (auth_token and management_url))
|
||||
|
||||
#FIXME(usrleon): Here should be restrict for project id same as
|
||||
# FIXME(usrleon): Here should be restrict for project id same as
|
||||
# for os_username or os_password but for compatibility it is not.
|
||||
if must_auth:
|
||||
if auth_plugin:
|
||||
|
@ -11,7 +11,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from distutils.version import StrictVersion
|
||||
import distutils.version as dist_version
|
||||
import re
|
||||
import sys
|
||||
|
||||
@ -200,7 +200,8 @@ class ShellTest(utils.TestCase):
|
||||
# default output of empty tables differs depending between prettytable
|
||||
# versions
|
||||
if (hasattr(prettytable, '__version__') and
|
||||
StrictVersion(prettytable.__version__) < StrictVersion('0.7.2')):
|
||||
dist_version.StrictVersion(prettytable.__version__) <
|
||||
dist_version.StrictVersion('0.7.2')):
|
||||
ex = '\n'
|
||||
else:
|
||||
ex = (
|
||||
|
@ -14,7 +14,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from datetime import datetime
|
||||
import datetime
|
||||
|
||||
import six
|
||||
from six.moves.urllib import parse
|
||||
@ -1495,13 +1495,17 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
'zone': 'nova',
|
||||
'status': 'enabled',
|
||||
'state': 'up',
|
||||
'updated_at': datetime(2012, 10, 29, 13, 42, 2)},
|
||||
'updated_at': datetime.datetime(
|
||||
2012, 10, 29, 13, 42, 2
|
||||
)},
|
||||
{'binary': binary,
|
||||
'host': host,
|
||||
'zone': 'nova',
|
||||
'status': 'disabled',
|
||||
'state': 'down',
|
||||
'updated_at': datetime(2012, 9, 18, 8, 3, 38)},
|
||||
'updated_at': datetime.datetime(
|
||||
2012, 9, 18, 8, 3, 38
|
||||
)},
|
||||
]})
|
||||
|
||||
def put_os_services_enable(self, body, **kw):
|
||||
@ -1785,7 +1789,9 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
"nova-compute": {"active": True,
|
||||
"available": True,
|
||||
"updated_at":
|
||||
datetime(2012, 12, 26, 14, 45, 25, 0)}}}},
|
||||
datetime.datetime(
|
||||
2012, 12, 26, 14, 45, 25, 0
|
||||
)}}}},
|
||||
{"zoneName": "internal",
|
||||
"zoneState": {"available": True},
|
||||
"hosts": {
|
||||
@ -1794,13 +1800,17 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||
"active": True,
|
||||
"available": True,
|
||||
"updated_at":
|
||||
datetime(2012, 12, 26, 14, 45, 25, 0)}},
|
||||
datetime.datetime(
|
||||
2012, 12, 26, 14, 45, 25, 0
|
||||
)}},
|
||||
"fake_host-2": {
|
||||
"nova-network": {
|
||||
"active": True,
|
||||
"available": False,
|
||||
"updated_at":
|
||||
datetime(2012, 12, 26, 14, 45, 24, 0)}}}},
|
||||
datetime.datetime(
|
||||
2012, 12, 26, 14, 45, 24, 0
|
||||
)}}}},
|
||||
{"zoneName": "zone-2",
|
||||
"zoneState": {"available": False},
|
||||
"hosts": None}]})
|
||||
|
@ -14,7 +14,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from datetime import datetime
|
||||
import datetime
|
||||
|
||||
from novaclient.openstack.common import strutils
|
||||
from novaclient.tests import fakes
|
||||
@ -282,7 +282,9 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
|
||||
"nova-compute": {"active": True,
|
||||
"available": True,
|
||||
"updated_at":
|
||||
datetime(2012, 12, 26, 14, 45, 25, 0)}}}},
|
||||
datetime.datetime(
|
||||
2012, 12, 26, 14, 45, 25, 0
|
||||
)}}}},
|
||||
{"zone_name": "internal",
|
||||
"zone_state": {"available": True},
|
||||
"hosts": {
|
||||
@ -291,13 +293,17 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient):
|
||||
"active": True,
|
||||
"available": True,
|
||||
"updated_at":
|
||||
datetime(2012, 12, 26, 14, 45, 25, 0)}},
|
||||
datetime.datetime(
|
||||
2012, 12, 26, 14, 45, 25, 0
|
||||
)}},
|
||||
"fake_host-2": {
|
||||
"nova-network": {
|
||||
"active": True,
|
||||
"available": False,
|
||||
"updated_at":
|
||||
datetime(2012, 12, 26, 14, 45, 24, 0)}}}},
|
||||
datetime.datetime(
|
||||
2012, 12, 26, 14, 45, 24, 0
|
||||
)}}}},
|
||||
{"zone_name": "zone-2",
|
||||
"zone_state": {"available": False},
|
||||
"hosts": None}]})
|
||||
|
@ -28,7 +28,8 @@ from novaclient import base
|
||||
from novaclient import crypto
|
||||
from novaclient.openstack.common.gettextutils import _
|
||||
from novaclient.openstack.common import strutils
|
||||
from novaclient.v1_1.security_groups import SecurityGroup
|
||||
from novaclient.v1_1 import security_groups
|
||||
|
||||
|
||||
REBOOT_SOFT, REBOOT_HARD = 'SOFT', 'HARD'
|
||||
|
||||
@ -1147,7 +1148,8 @@ class ServerManager(base.BootingManagerWithFind):
|
||||
|
||||
"""
|
||||
return self._list('/servers/%s/os-security-groups' %
|
||||
base.getid(server), 'security_groups', SecurityGroup)
|
||||
base.getid(server), 'security_groups',
|
||||
security_groups.SecurityGroup)
|
||||
|
||||
def evacuate(self, server, host, on_shared_storage, password=None):
|
||||
"""
|
||||
|
@ -1151,7 +1151,7 @@ def do_image_delete(cs, args):
|
||||
const=1,
|
||||
help=argparse.SUPPRESS)
|
||||
@utils.arg('--tenant',
|
||||
#nova db searches by project_id
|
||||
# nova db searches by project_id
|
||||
dest='tenant',
|
||||
metavar='<tenant>',
|
||||
nargs='?',
|
||||
@ -2581,7 +2581,7 @@ def _find_keypair(cs, keypair):
|
||||
|
||||
|
||||
@utils.arg('--tenant',
|
||||
#nova db searches by project_id
|
||||
# nova db searches by project_id
|
||||
dest='tenant',
|
||||
metavar='<tenant>',
|
||||
nargs='?',
|
||||
|
@ -97,7 +97,7 @@ class Client(object):
|
||||
self.tenant_id = tenant_id
|
||||
self.user_id = user_id
|
||||
self.os_cache = os_cache or not no_cache
|
||||
#TODO(bnemec): Add back in v3 extensions
|
||||
# TODO(bnemec): Add back in v3 extensions
|
||||
self.agents = agents.AgentsManager(self)
|
||||
self.aggregates = aggregates.AggregateManager(self)
|
||||
self.availability_zones = \
|
||||
|
@ -950,7 +950,7 @@ def do_image_delete(cs, args):
|
||||
const=1,
|
||||
help=argparse.SUPPRESS)
|
||||
@utils.arg('--tenant',
|
||||
#nova db searches by project_id
|
||||
# nova db searches by project_id
|
||||
dest='tenant',
|
||||
metavar='<tenant>',
|
||||
nargs='?',
|
||||
|
23
tox.ini
23
tox.ini
@ -26,8 +26,23 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
|
||||
downloadcache = ~/cache/pip
|
||||
|
||||
[flake8]
|
||||
# TODO fix following rules from hacking 0.9
|
||||
# E265,H402,H405,H904
|
||||
ignore = E12,E265,F811,F821,H302,H402,H404,H405,H904
|
||||
# Following checks should be enabled in the future.
|
||||
#
|
||||
# H404 multi line docstring should start without a leading new line
|
||||
# H405 multi line docstring summary not separated with an empty line
|
||||
#
|
||||
# Following checks are ignored on purpose.
|
||||
#
|
||||
# H402 one line docstring needs punctuation
|
||||
# reason: removed in hacking (https://review.openstack.org/#/c/101497/)
|
||||
#
|
||||
# H904 wrap long lines in parentheses instead of a backslash
|
||||
# reason: removed in hacking (https://review.openstack.org/#/c/101701/)
|
||||
#
|
||||
# Additional checks are also ignored on purpose: E12, F811, F821
|
||||
ignore = E12,F811,F821,H402,H404,H405,H904
|
||||
show-source = True
|
||||
exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build
|
||||
exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,doc/source/conf.py
|
||||
|
||||
[hacking]
|
||||
import_exceptions = novaclient.openstack.common.gettextutils
|
||||
|
Loading…
x
Reference in New Issue
Block a user