Fix D401 PEP257 violation and enable H403

Currently tox ignores D401 and H403:
401: First line should be in imperative mood.
403: multi line docstrings should end on a new line

This change makes keystonemiddleware docstrings compliant with D401.
H403 is already passing, so this commit also enables it.

Change-Id: I9471721220c99f9c4ed055840ed626bb7750eb3f
This commit is contained in:
Navid Pustchi 2016-05-04 22:08:29 +00:00 committed by Samuel de Medeiros Queiroz
parent 89ec136e5a
commit 92983b1da8
7 changed files with 9 additions and 11 deletions

View File

@ -444,7 +444,7 @@ class AuditMiddleware(object):
def filter_factory(global_conf, **local_conf):
"""Returns a WSGI filter app for use with paste.deploy."""
"""Return a WSGI filter app for use with paste.deploy."""
conf = global_conf.copy()
conf.update(local_conf)

View File

@ -915,7 +915,7 @@ class AuthProtocol(BaseAuthProtocol):
raise ksm_exceptions.InvalidToken(msg)
def _cms_verify(self, data, inform=cms.PKI_ASN1_FORM):
"""Verifies the signature of the provided data's IAW CMS syntax.
"""Verify the signature of the provided data's IAW CMS syntax.
If either of the certificate files might be missing, fetch them and
retry.
@ -1100,7 +1100,7 @@ class AuthProtocol(BaseAuthProtocol):
def filter_factory(global_conf, **local_conf):
"""Returns a WSGI filter app for use with paste.deploy."""
"""Return a WSGI filter app for use with paste.deploy."""
conf = global_conf.copy()
conf.update(local_conf)

View File

@ -88,7 +88,7 @@ if sys.version_info >= (3, 3):
constant_time_compare = hmac.compare_digest
else:
def constant_time_compare(first, second):
"""Returns True if both string inputs are equal, otherwise False.
"""Return True if both string inputs are equal, otherwise False.
This function should take a constant amount of time regardless of
how many characters in the strings match.
@ -107,7 +107,7 @@ else:
def derive_keys(token, secret, strategy):
"""Derives keys for MAC and ENCRYPTION from the user-provided secret.
"""Derive keys for MAC and ENCRYPTION from the user-provided secret.
The resulting keys should be passed to the protect and unprotect functions.

View File

@ -95,7 +95,7 @@ class _TokenData(object):
@property
def trust_id(self):
"""Returns the trust id associated with the authentication request..
"""Return the trust id associated with the authentication request..
:rtype: str
"""

View File

@ -206,7 +206,7 @@ class EC2Token(object):
def filter_factory(global_conf, **local_conf):
"""Returns a WSGI filter app for use with paste.deploy."""
"""Return a WSGI filter app for use with paste.deploy."""
conf = global_conf.copy()
conf.update(local_conf)

View File

@ -261,7 +261,7 @@ class S3Token(object):
def filter_factory(global_conf, **local_conf):
"""Returns a WSGI filter app for use with paste.deploy."""
"""Return a WSGI filter app for use with paste.deploy."""
conf = global_conf.copy()
conf.update(local_conf)

View File

@ -47,9 +47,7 @@ commands = oslo_debug_helper {posargs}
# D209: Multi-line docstring closing quotes should be on a separate line
# D301: Use r""" if any backslashes in a docstring
# D400: First line should end with a period
# D401: First line should be in imperative mood
# H403: multi line docstrings should end on a new line
ignore = D100,D101,D102,D103,D104,D105,D200,D202,D209,D301,D204,D400,D401,H403
ignore = D100,D101,D102,D103,D104,D105,D200,D202,D209,D301,D204,D400
show-source = True
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*