diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-11-07 19:43:51 +0000 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-11-07 20:26:07 +0000 |
commit | db499390944a7ebd033dda1da2cce40dcae6b7cf (patch) | |
tree | 13385b786934b70b0403b049dbe98dc32ba4a65a /validate.py | |
parent | 87f4f40d2731bfca4c51ca8d6a8549662db87cd1 (diff) |
validate: fix validation return code
Only return code for last checked file was returned. Now the highest
return code is returned for the list of files
Change-Id: I795e891b995eec121187778e4213f96e08d171b3
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Diffstat (limited to 'validate.py')
-rwxr-xr-x | validate.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/validate.py b/validate.py index 30e7479..1e981b4 100755 --- a/validate.py +++ b/validate.py @@ -156,8 +156,9 @@ def validate_file(args, path): exitcode = pep8_check(path, args.pep8_ignore) elif path.endswith(".php"): exitcode = validate_php(path) - else: - # try shellcheck by default + elif path.endswith(".sh") or \ + path.endswith("sh-test-lib") or \ + path.endswith("android-test-lib"): exitcode = validate_shell(path, args.shellcheck_ignore) return exitcode @@ -166,14 +167,18 @@ def run_unit_tests(args, filelist=None): exitcode = 0 if filelist is not None: for filename in filelist: - exitcode = validate_file(args, filename) + tmp_exitcode = validate_file(args, filename) + if tmp_exitcode != 0: + exitcode = 1 else: for root, dirs, files in os.walk('.'): if not root.startswith("./.git"): for name in files: - exitcode = validate_file( + tmp_exitcode = validate_file( args, root + "/" + name) + if tmp_exitcode != 0: + exitcode = 1 return exitcode |