summaryrefslogtreecommitdiff
path: root/validate.py
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-11-07 10:45:34 +0000
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-11-07 14:38:46 +0000
commitab7645abf4e020b1179a514dd7cf9fbe48987b30 (patch)
treef23a82e1dd2d3fd30b057ad0eeb96f466ab38d78 /validate.py
parent7ae041cf6a998210ce4773470732410e35c1df8e (diff)
downloadtest-definitions-pipe-ab7645abf4e020b1179a514dd7cf9fbe48987b30.tar.gz
validate.py: fixed exclude options
Change-Id: I833bd814ada37c3b06222b9c8f07e2c0a92e15ac Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Diffstat (limited to 'validate.py')
-rwxr-xr-xvalidate.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/validate.py b/validate.py
index 94d394e..30e7479 100755
--- a/validate.py
+++ b/validate.py
@@ -29,7 +29,7 @@ def publish_result(result_message_list):
print_stderr(result_message)
-def pep8_check(filepath, ignore_options=None):
+def pep8_check(filepath, ignore_options=[]):
_fmt = "%(row)d:%(col)d: %(code)s %(text)s"
options = {
'ignore': ignore_options,
@@ -118,7 +118,9 @@ def validate_yaml(filename):
def validate_shell(filename, ignore_options):
ignore_string = ""
if ignore_options is not None:
- ignore_string = "-e %s" % ignore_options
+ ignore_string = "-e %s" % " ".join(ignore_options)
+ if len(ignore_string) < 4: # contains only "-e "
+ ignore_string = ""
cmd = 'shellcheck %s' % ignore_string
return validate_external(cmd, filename, "SHELLCHECK")
@@ -196,7 +198,7 @@ if __name__ == '__main__':
parser.add_argument("-p",
"--pep8-ignore",
nargs="*",
- default="E501",
+ default=["E501"],
help="Space separated list of pep8 exclusions",
dest="pep8_ignore")
parser.add_argument("-s",