aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2019-01-11 14:18:28 +0800
committermwasilew <milosz.wasilewski@linaro.org>2019-01-11 12:06:40 +0000
commit6b5b465db2483ad393ce58c211a39c8486d017ea (patch)
tree89be07af1e0574db6f3d0404f18f1436a93fd1ac
parentef8f6a1e2ba20c141497d7f9d276bae47065010a (diff)
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>
-rw-r--r--.travis.yml4
-rwxr-xr-xsanity-check.sh12
-rwxr-xr-xvalidate.py2
3 files changed, 15 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index 22706b3..4801764 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,9 @@ python:
- "3.6"
# Pre-installed packages.
-# shellcheck 0.5.0
+# shellcheck v0.5.0
+# Refer to the following link to install specific version shellcheck binary.
+# https://github.com/koalaman/shellcheck#installing-the-shellcheck-binary
# php 7.2
install:
- pip install pyyaml pycodestyle
diff --git a/sanity-check.sh b/sanity-check.sh
index 9174831..e72c7ed 100755
--- a/sanity-check.sh
+++ b/sanity-check.sh
@@ -5,4 +5,14 @@ python3 validate.py \
-g \
-r build-error.txt \
-p E501 \
- -s SC1091
+ -s SC1091 SC2230
+
+# pycodestyle checks skipped:
+# E510: line too long
+
+# Shellchecks skipped:
+# SC1091: not following
+
+# Reason: 'which' is widely used and supported. And 'command' applets isn't
+# available in busybox, refer to https://busybox.net/downloads/BusyBox.html
+# SC2230: which is non-standard. Use builtin 'command -v' instead.
diff --git a/validate.py b/validate.py
index 28c62e4..236516f 100755
--- a/validate.py
+++ b/validate.py
@@ -236,7 +236,7 @@ def main(args):
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)