Fix pep8 gate
This updates the test-requirements to more recent flake8-docstrings and pep8 versions. I also added some more ignores that would take significant work to update and fixed some minor linting issues. Change-Id: Ia416658b8a4bfb8f43f8df170053abb3ae958d44
This commit is contained in:
parent
aeeb64d349
commit
dc0b796495
@ -35,12 +35,11 @@ class OAuth2Protocol(AuthProtocol):
|
|||||||
super(OAuth2Protocol, self).__init__(app, conf)
|
super(OAuth2Protocol, self).__init__(app, conf)
|
||||||
|
|
||||||
def _is_valid_access_token(self, request):
|
def _is_valid_access_token(self, request):
|
||||||
"""Check if the request contains an OAuth2.0 access token
|
"""Check if the request contains an OAuth2.0 access token.
|
||||||
|
|
||||||
:param request: Incoming request
|
:param request: Incoming request
|
||||||
:type request: _request.AuthTokenRequest
|
:type request: _request.AuthTokenRequest
|
||||||
"""
|
"""
|
||||||
|
|
||||||
access_token = None
|
access_token = None
|
||||||
if (request.authorization and
|
if (request.authorization and
|
||||||
request.authorization.authtype == 'Bearer'):
|
request.authorization.authtype == 'Bearer'):
|
||||||
@ -69,7 +68,6 @@ class OAuth2Protocol(AuthProtocol):
|
|||||||
:param request: Incoming request
|
:param request: Incoming request
|
||||||
:type request: _request.AuthTokenRequest
|
:type request: _request.AuthTokenRequest
|
||||||
"""
|
"""
|
||||||
|
|
||||||
request.remove_auth_headers()
|
request.remove_auth_headers()
|
||||||
self._token_cache.initialize(request.environ)
|
self._token_cache.initialize(request.environ)
|
||||||
if (not self._is_valid_access_token(request)
|
if (not self._is_valid_access_token(request)
|
||||||
@ -96,7 +94,6 @@ class OAuth2Protocol(AuthProtocol):
|
|||||||
|
|
||||||
def filter_factory(global_conf, **local_conf):
|
def filter_factory(global_conf, **local_conf):
|
||||||
"""Return a WSGI filter app for use with paste.deploy."""
|
"""Return a WSGI filter app for use with paste.deploy."""
|
||||||
|
|
||||||
conf = global_conf.copy()
|
conf = global_conf.copy()
|
||||||
conf.update(local_conf)
|
conf.update(local_conf)
|
||||||
|
|
||||||
|
@ -3,14 +3,16 @@
|
|||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
|
|
||||||
hacking>=3.0,<4.0.0 # Apache-2.0
|
hacking>=3.0,<4.0.0 # Apache-2.0
|
||||||
flake8-docstrings==0.2.1.post1 # MIT
|
flake8-docstrings==1.6.0 # MIT
|
||||||
|
pep8==1.7.1 # MIT
|
||||||
|
|
||||||
|
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
coverage!=4.4,>=4.0 # Apache-2.0
|
||||||
cryptography>=3.0 # BSD/Apache-2.0
|
cryptography>=3.0 # BSD/Apache-2.0
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
oslotest>=3.2.0 # Apache-2.0
|
oslotest>=3.2.0 # Apache-2.0
|
||||||
requests-mock>=1.2.0 # Apache-2.0
|
|
||||||
stevedore>=1.20.0 # Apache-2.0
|
stevedore>=1.20.0 # Apache-2.0
|
||||||
|
requests-mock>=1.2.0 # Apache-2.0
|
||||||
stestr>=2.0.0 # Apache-2.0
|
stestr>=2.0.0 # Apache-2.0
|
||||||
testresources>=2.0.0 # Apache-2.0/BSD
|
testresources>=2.0.0 # Apache-2.0/BSD
|
||||||
testtools>=2.2.0 # MIT
|
testtools>=2.2.0 # MIT
|
||||||
|
5
tox.ini
5
tox.ini
@ -49,10 +49,11 @@ commands = oslo_debug_helper -t keystonemiddleware/tests {posargs}
|
|||||||
# D102: Missing docstring in public method
|
# D102: Missing docstring in public method
|
||||||
# D103: Missing docstring in public function
|
# D103: Missing docstring in public function
|
||||||
# D104: Missing docstring in public package
|
# D104: Missing docstring in public package
|
||||||
# D203: 1 blank line required before class docstring (deprecated in pep257)
|
# D107: Missing docstring in __init__
|
||||||
|
# D401: First line should be in imperative mood
|
||||||
# W503 line break before binary operator
|
# W503 line break before binary operator
|
||||||
# W504 line break after binary operator
|
# W504 line break after binary operator
|
||||||
ignore = D100,D101,D102,D103,D104,D203,W503,W504
|
ignore = D100,D101,D102,D103,D104,D107,D401,W503,W504
|
||||||
show-source = True
|
show-source = True
|
||||||
exclude = .venv,.tox,dist,doc,*egg,build
|
exclude = .venv,.tox,dist,doc,*egg,build
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user