Fix H405, D105, D200, and D203 PEP257

Curently tox ignores H405, D105, D200, and D203.
H405: multi line docstring summary not separated with an empty line.
D105: Missing docstring in magic method.
D200: One-line docstring should fit on one line with quotes.
D203: 1 blank required before class docstring.
This patch removes tox ignores and fix docstrings.

Change-Id: Ia3ac9796630e24ce04dc9f38a8d944334d6978d2
This commit is contained in:
Navid Pustchi 2016-04-19 19:47:36 +00:00 committed by Steve Martinelli
parent f95a3bb6bc
commit 21d5ba92e0
8 changed files with 11 additions and 16 deletions

View File

@ -16,9 +16,7 @@
# License for the specific language governing permissions and limitations
# under the License.
"""
HTTP Exceptions used by keystoneauth1.
"""
"""HTTP Exceptions used by keystoneauth1."""
import inspect
import sys

View File

@ -16,8 +16,7 @@ __all__ = ('ServiceProviderNotFound',)
class ServiceProviderNotFound(base.ClientException):
"""A Service Provider cannot be found.
"""
"""A Service Provider cannot be found."""
def __init__(self, sp_id):
self.sp_id = sp_id

View File

@ -130,8 +130,7 @@ class _OidcBase(federation.FederationBaseAuth):
class OidcPassword(_OidcBase):
"""Implementation for OpenID Connect Resource Owner Password Credential.
"""
"""Implementation for OpenID Connect Resource Owner Password Credential."""
@positional(4)
def __init__(self, auth_url, identity_provider, protocol,

View File

@ -95,6 +95,7 @@ class Opt(object):
self.group = None
def __repr__(self):
"""Return string representation of option name."""
return '<Opt: %s>' % self.name
def _to_oslo_opt(self):
@ -116,6 +117,7 @@ class Opt(object):
metavar=self.metavar)
def __eq__(self, other):
"""Define equality operator on option parameters."""
return (type(self) == type(other) and
self.name == other.name and
self.type == other.type and

View File

@ -72,7 +72,8 @@ def create_plugin(opts=[], token=None, endpoint=None):
class BoolType(object):
def __eq__(self, other):
# hack around oslo.config type comparison
"""Define equiality for many bool types."""
# hack around oslo.config equality comparison
return type(self) == type(other)
def __call__(self, value):

View File

@ -17,14 +17,13 @@ from testtools import matchers
class XMLEquals(object):
"""Parses two XML documents from strings and compares the results.
"""
"""Parses two XML documents from strings and compares the results."""
def __init__(self, expected):
self.expected = expected
def __str__(self):
"""Return string representation of xml document info."""
return "%s(%r)" % (self.__class__.__name__, self.expected)
def match(self, other):

View File

@ -128,6 +128,7 @@ class TestResponse(requests.Response):
self.status_code = data
def __eq__(self, other):
"""Define equiality behavior of request and response."""
return self.__dict__ == other.__dict__
@property

View File

@ -29,16 +29,12 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
commands = oslo_debug_helper -t keystoneauth1/tests {posargs}
[flake8]
# H405: multi line docstring summary not separated with an empty line
# D100: Missing docstring in public module
# D101: Missing docstring in public class
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D104: Missing docstring in public package
# D105: Missing docstring in magic method
# D200: One-line docstring should fit on one line with quotes
# D203: 1 blank required before class docstring.
ignore = H405,D100,D101,D102,D103,D104,D105,D200,D203
ignore = D100,D101,D102,D103,D104
show-source = True
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*