From ab7645abf4e020b1179a514dd7cf9fbe48987b30 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Mon, 7 Nov 2016 10:45:34 +0000 Subject: validate.py: fixed exclude options Change-Id: I833bd814ada37c3b06222b9c8f07e2c0a92e15ac Signed-off-by: Milosz Wasilewski --- validate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'validate.py') 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", -- cgit v1.2.3