Fix D204 PEP257 violation and enable D301 and D209
Currently tox ignores D204, D209 and D301: D204: 1 blank line required after class docstring. D209: Multi-line docstring closing quotes should be on a separate line. D301: Use r""" if any backslashes in a docstring. This change makes keystonemiddleware docstrings compliant with D204. D209 and D301 is already passing, so this commit also enables them. Change-Id: I11e02ef5af7fc793f1a2438e091bbfb18618a7f5
This commit is contained in:
parent
d7bf1a759d
commit
ed931a00d8
@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
r"""
|
||||
Token-based Authentication Middleware.
|
||||
|
||||
This WSGI component:
|
||||
|
@ -84,6 +84,7 @@ class _CachePool(list):
|
||||
|
||||
class _MemcacheClientPool(object):
|
||||
"""An advanced memcached client pool that is eventlet safe."""
|
||||
|
||||
def __init__(self, memcache_servers, **kwargs):
|
||||
self._pool = memcache_pool.MemcacheClientPool(memcache_servers,
|
||||
**kwargs)
|
||||
|
@ -56,6 +56,7 @@ class InvalidMacError(Exception):
|
||||
This usually indicates that data had been expectedly modified in memcache.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@ -63,6 +64,7 @@ class DecryptError(Exception):
|
||||
"""raise when unable to decrypt encrypted data.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@ -70,6 +72,7 @@ class CryptoUnavailableError(Exception):
|
||||
"""raise when Python Crypto module is not available.
|
||||
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
@ -42,6 +42,7 @@ class ConnectionPool(queue.Queue):
|
||||
This class implements the basic connection pool logic as an abstract base
|
||||
class.
|
||||
"""
|
||||
|
||||
def __init__(self, maxsize, unused_timeout, conn_get_timeout=None):
|
||||
"""Initialize the connection pool.
|
||||
|
||||
|
@ -41,6 +41,7 @@ def echo_app(environ, start_response):
|
||||
|
||||
class EchoService(object):
|
||||
"""Runs an instance of the echo app on init."""
|
||||
|
||||
def __init__(self):
|
||||
# hardcode any non-default configuration here
|
||||
conf = {'auth_protocol': 'http', 'admin_token': 'ADMIN'}
|
||||
|
@ -264,6 +264,7 @@ class BaseAuthTokenMiddlewareTest(base.BaseAuthTokenTestCase):
|
||||
this to specify, for instance, v3 format.
|
||||
|
||||
"""
|
||||
|
||||
def setUp(self, expected_env=None, auth_version=None, fake_app=None):
|
||||
super(BaseAuthTokenMiddlewareTest, self).setUp()
|
||||
|
||||
|
@ -41,6 +41,7 @@ class FakeResponse(object):
|
||||
|
||||
class FakeApp(object):
|
||||
"""This represents a WSGI app protected by the auth_token middleware."""
|
||||
|
||||
def __call__(self, env, start_response):
|
||||
resp = webob.Response()
|
||||
resp.environ = env
|
||||
|
@ -30,6 +30,7 @@ GOOD_RESPONSE = {'access': {'token': {'id': 'TOKEN_ID',
|
||||
|
||||
class FakeApp(object):
|
||||
"""This represents a WSGI app protected by the auth_token middleware."""
|
||||
|
||||
def __call__(self, env, start_response):
|
||||
resp = webob.Response()
|
||||
resp.environ = env
|
||||
|
5
tox.ini
5
tox.ini
@ -43,10 +43,7 @@ commands = oslo_debug_helper {posargs}
|
||||
# D105: Missing docstring in magic method
|
||||
# D200: One-line docstring should fit on one line with quotes
|
||||
# D202: No blank lines allowed after function docstring
|
||||
# D204: 1 blank line required after class docstring
|
||||
# D209: Multi-line docstring closing quotes should be on a separate line
|
||||
# D301: Use r""" if any backslashes in a docstring
|
||||
ignore = D100,D101,D102,D103,D104,D105,D200,D202,D209,D301,D204
|
||||
ignore = D100,D101,D102,D103,D104,D105,D200,D202
|
||||
show-source = True
|
||||
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user