Pin pep8 1.3.3
Apart of making pep8 version standard across all openstack projects. Also fix tools/hacking.py so it is compliant for pep8 1.2 and beyond, taken from fbc4568 in the nova tree. Change-Id: I801c98a01960fa113dae1b6174c1a06bb149fea3 Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:
parent
55c09da1b0
commit
ceee1fdaf2
@ -16,10 +16,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
import webob
|
|
||||||
from lxml import etree
|
|
||||||
import iso8601
|
import iso8601
|
||||||
|
from lxml import etree
|
||||||
|
import webob
|
||||||
|
|
||||||
from cinder.api.openstack import volume
|
from cinder.api.openstack import volume
|
||||||
from cinder.api.openstack import xmlutil
|
from cinder.api.openstack import xmlutil
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
from cinder.api.openstack import volume
|
from cinder.api.openstack import volume
|
||||||
from cinder.api.openstack.volume import snapshots
|
from cinder.api.openstack.volume import snapshots
|
||||||
from cinder.api.openstack.volume import volumes
|
|
||||||
from cinder.api.openstack.volume import versions
|
from cinder.api.openstack.volume import versions
|
||||||
|
from cinder.api.openstack.volume import volumes
|
||||||
from cinder.api.openstack import wsgi
|
from cinder.api.openstack import wsgi
|
||||||
from cinder import flags
|
from cinder import flags
|
||||||
from cinder.openstack.common import log as logging
|
from cinder.openstack.common import log as logging
|
||||||
|
@ -116,7 +116,7 @@ function run_pep8 {
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Until all these issues get fixed, ignore.
|
# Until all these issues get fixed, ignore.
|
||||||
ignore='--ignore=N4,N306'
|
ignore='--ignore=N4,E12,E711,E712,E721,E502'
|
||||||
${wrapper} python tools/hacking.py ${ignore} ${srcfiles}
|
${wrapper} python tools/hacking.py ${ignore} ${srcfiles}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ def cinder_except_format(logical_line):
|
|||||||
N201
|
N201
|
||||||
"""
|
"""
|
||||||
if logical_line.startswith("except:"):
|
if logical_line.startswith("except:"):
|
||||||
return 6, "CINDER N201: no 'except:' at least use 'except Exception:'"
|
yield 6, "CINDER N201: no 'except:' at least use 'except Exception:'"
|
||||||
|
|
||||||
|
|
||||||
def cinder_except_format_assert(logical_line):
|
def cinder_except_format_assert(logical_line):
|
||||||
@ -99,7 +99,7 @@ def cinder_except_format_assert(logical_line):
|
|||||||
N202
|
N202
|
||||||
"""
|
"""
|
||||||
if logical_line.startswith("self.assertRaises(Exception"):
|
if logical_line.startswith("self.assertRaises(Exception"):
|
||||||
return 1, "CINDER N202: assertRaises Exception too broad"
|
yield 1, "CINDER N202: assertRaises Exception too broad"
|
||||||
|
|
||||||
|
|
||||||
def cinder_one_import_per_line(logical_line):
|
def cinder_one_import_per_line(logical_line):
|
||||||
@ -117,7 +117,7 @@ def cinder_one_import_per_line(logical_line):
|
|||||||
if pos > -1 and (parts[0] == "import" or
|
if pos > -1 and (parts[0] == "import" or
|
||||||
parts[0] == "from" and parts[2] == "import") and \
|
parts[0] == "from" and parts[2] == "import") and \
|
||||||
not is_import_exception(parts[1]):
|
not is_import_exception(parts[1]):
|
||||||
return pos, "CINDER N301: one import per line"
|
yield pos, "CINDER N301: one import per line"
|
||||||
|
|
||||||
_missingImport = set([])
|
_missingImport = set([])
|
||||||
|
|
||||||
@ -191,7 +191,9 @@ def cinder_import_module_only(logical_line):
|
|||||||
(len(split_line) == 2 or
|
(len(split_line) == 2 or
|
||||||
(len(split_line) == 4 and split_line[2] == "as"))):
|
(len(split_line) == 4 and split_line[2] == "as"))):
|
||||||
mod = split_line[1]
|
mod = split_line[1]
|
||||||
return importModuleCheck(mod)
|
rval = importModuleCheck(mod)
|
||||||
|
if rval != None:
|
||||||
|
yield rval
|
||||||
|
|
||||||
# TODO(jogo) handle "from x import *"
|
# TODO(jogo) handle "from x import *"
|
||||||
|
|
||||||
@ -348,7 +350,7 @@ def cinder_localization_strings(logical_line, tokens):
|
|||||||
map(gen.send, tokens)
|
map(gen.send, tokens)
|
||||||
gen.close()
|
gen.close()
|
||||||
except LocalizationError as e:
|
except LocalizationError as e:
|
||||||
return e.args
|
yield e.args
|
||||||
|
|
||||||
#TODO(jogo) Dict and list objects
|
#TODO(jogo) Dict and list objects
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ nose
|
|||||||
nosexcover
|
nosexcover
|
||||||
openstack.nose_plugin
|
openstack.nose_plugin
|
||||||
nosehtmloutput
|
nosehtmloutput
|
||||||
pep8==1.1
|
pep8==1.3.3
|
||||||
pylint==0.25.2
|
pylint==0.25.2
|
||||||
sphinx>=1.1.2
|
sphinx>=1.1.2
|
||||||
MySQL-python
|
MySQL-python
|
||||||
|
6
tox.ini
6
tox.ini
@ -13,11 +13,11 @@ deps = -r{toxinidir}/tools/pip-requires
|
|||||||
commands = /bin/bash run_tests.sh -N -P {posargs}
|
commands = /bin/bash run_tests.sh -N -P {posargs}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps = pep8==1.1
|
deps = pep8==1.3.3
|
||||||
commands =
|
commands =
|
||||||
python tools/hacking.py --ignore=N4,E12,E711,E721 --repeat --show-source \
|
python tools/hacking.py --ignore=N4,E12,E711,E712,E721,E502 --repeat --show-source \
|
||||||
--exclude=.venv,.tox,dist,doc,openstack,*egg .
|
--exclude=.venv,.tox,dist,doc,openstack,*egg .
|
||||||
python tools/hacking.py --ignore=N4,E12,E711,E721 --repeat --show-source \
|
python tools/hacking.py --ignore=N4,E12,E711,E712,E721,E502 --repeat --show-source \
|
||||||
--filename=cinder* bin
|
--filename=cinder* bin
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user