Add pylint with indent check

This is an initial creation of pylint with a basic indent checker.
Small issues corrected.  Job added to gate with
Ib554a284e92583cc1d6a5c2219b3922852ca4c73

Change-Id: I7e24d8348db3aef79e1395d12692199a1f80161a
Co-Authored-By: Andreas Florath <andreas@florath.net>
This commit is contained in:
Ian Wienand 2017-05-29 16:05:35 +10:00
parent 3ac57740c6
commit 543dc1baa6
4 changed files with 25 additions and 10 deletions

View File

@ -31,9 +31,11 @@ def _populate_element(element_dir, element_name, element_deps=[], provides=[]):
element_home = os.path.join(element_dir, element_name) element_home = os.path.join(element_dir, element_name)
os.mkdir(element_home) os.mkdir(element_home)
deps_path = os.path.join(element_home, 'element-deps') deps_path = os.path.join(element_home, 'element-deps')
with open(deps_path, 'w') as deps_file: with open(deps_path, 'w') as deps_file:
deps_file.write("\n".join(element_deps)) deps_file.write("\n".join(element_deps))
provides_path = os.path.join(element_home, 'element-provides') provides_path = os.path.join(element_home, 'element-provides')
with open(provides_path, 'w') as provides_file: with open(provides_path, 'w') as provides_file:
provides_file.write("\n".join(provides)) provides_file.write("\n".join(provides))

7
pylint.cfg Normal file
View File

@ -0,0 +1,7 @@
[MASTER]
persistent=no
[MESSAGES CONTROL]
disable=all
enable=bad-indentation

View File

@ -2,6 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking<0.11,>=0.10.0 hacking<0.11,>=0.10.0
pylint==1.4.5 # GPLv2
oslotest>=1.10.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD testrepository>=0.0.18 # Apache-2.0/BSD

View File

@ -16,6 +16,11 @@ commands =
flake8 {posargs} flake8 {posargs}
dib-lint dib-lint
[testenv:pylint]
setenv = VIRTUAL_ENV={envdir}
deps = pylint
commands = pylint --rcfile pylint.cfg diskimage_builder
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}