Fix shell check errors & enforce it in CI
- CI already has infrastructure to enfore shell check errors
but it was not leveraged as the repo does not have a .shellcheck
file.
- CI always throws the below warning in every CI
In bootstrap.sh line 11:
find -name "$file" | xargs -r rm -rf
^----------------^ SC2038: Use -print0/-0 or -exec + to allow for non-alphanumeric filenames.
^--^ SC2185: Some finds don't have a default path. Specify '.' explicitly.
In bootstrap.sh line 18:
echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
-- SC2016: Expressions don't expand in single quotes, use double quotes for that.
- Fixed SC2185,SC2038 and supressed SC2016 shell check errors.
more information regarding this errors are found at
https://github.com/koalaman/shellcheck/wiki/
TestedBy:
https://www.shellcheck.net/
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I1323741fc8ea344b6ea4e7cdf2c1b87bb8611523
diff --git a/.shellcheck b/.shellcheck
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.shellcheck
diff --git a/bootstrap.sh b/bootstrap.sh
index 50b75b7..ef3ea85 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -8,11 +8,12 @@
clean)
test -f Makefile && make maintainer-clean
for file in ${AUTOCONF_FILES}; do
- find -name "$file" | xargs -r rm -rf
+ find . -name "$file" | xargs -0 -r rm -rf
done
exit 0
;;
esac
autoreconf -i
+# shellcheck disable=SC2016
echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'