From 1803b638232ba399bfb13e5207958a3a63b92434 Mon Sep 17 00:00:00 2001 From: ZhijunWei Date: Fri, 28 Dec 2018 22:52:17 +0800 Subject: Update hacking version Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: Ide3a556918f341de6eafecb36ca431da40a0aed0 Closes-Bug: #1815715 --- HACKING.rst | 4 ++-- oslo_utils/reflection.py | 4 ++-- oslo_utils/strutils.py | 4 ++-- test-requirements.txt | 2 +- tox.ini | 3 ++- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/HACKING.rst b/HACKING.rst index 902191e..71dac05 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,4 +1,4 @@ oslo.utils Style Commandments -====================================================== +============================= -Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ \ No newline at end of file +Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ diff --git a/oslo_utils/reflection.py b/oslo_utils/reflection.py index acd82ca..f1801b8 100644 --- a/oslo_utils/reflection.py +++ b/oslo_utils/reflection.py @@ -208,8 +208,8 @@ def get_callable_args(function, required_only=False): sig = get_signature(function) function_args = list(six.iterkeys(sig.parameters)) for param_name, p in six.iteritems(sig.parameters): - if (p.kind in (Parameter.VAR_POSITIONAL, Parameter.VAR_KEYWORD) - or (required_only and p.default is not Parameter.empty)): + if (p.kind in (Parameter.VAR_POSITIONAL, Parameter.VAR_KEYWORD) or + (required_only and p.default is not Parameter.empty)): function_args.remove(param_name) return function_args diff --git a/oslo_utils/strutils.py b/oslo_utils/strutils.py index d7b104d..1edcf5a 100644 --- a/oslo_utils/strutils.py +++ b/oslo_utils/strutils.py @@ -554,8 +554,8 @@ def split_by_commas(value): .. versionadded:: 3.17 """ - word = (pp.QuotedString(quoteChar='"', escChar='\\') - | pp.Word(pp.printables, excludeChars='",')) + word = (pp.QuotedString(quoteChar='"', escChar='\\') | + pp.Word(pp.printables, excludeChars='",')) grammar = pp.stringStart + pp.delimitedList(word) + pp.stringEnd try: diff --git a/test-requirements.txt b/test-requirements.txt index 9354098..767c41b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 eventlet>=0.18.2,!=0.18.3,!=0.20.1,!=0.21.0,!=0.23.0 # MIT fixtures>=3.0.0 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 0edd989..ec099e4 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,8 @@ basepython = python3 commands = bandit -r oslo_utils -x tests -n5 [flake8] -ignore = E123,H405 +# E731 skipped as assign a lambda expression +ignore = E123,E731,H405 show-source = True exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,__init__.py -- cgit v1.2.1