Improve sanity check
* Use 'git diff --name-only HEAD~1' to list changed files as
"git show --name-only --format=''" doesn't work for pull requests.
* Add instructions on the installation of a specific version shellcheck.
* Add descriptions for the skipped pycodestyle and shellcheck codes.
* Skip the following shellcheck as 'which' is widely used and supported
and busybox doesn't support 'command'.
SC2230: which is non-standard. Use builtin 'command -v' instead.
Signed-off-by: Chase Qi <chase.qi@linaro.org>
diff --git a/validate.py b/validate.py
index 28c62e4..236516f 100755
--- a/validate.py
+++ b/validate.py
@@ -236,7 +236,7 @@
if args.git_latest:
# check if git exists
git_status, git_result = subprocess.getstatusoutput(
- "git show --name-only --format=''")
+ "git diff --name-only HEAD~1")
if git_status == 0:
filelist = git_result.split()
exitcode = run_unit_tests(args, filelist)