shellcheck: Error SC2119 doesn't apply to our use cases

Ignoring error SC2119 because they are false positives and I don't see cases
where that would return anything useful for us.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
Otavio Pontes
2020-04-30 08:50:48 -07:00
parent a3c1f97c57
commit ce0943982a
6 changed files with 6 additions and 11 deletions
+6 -2
View File
@@ -7,6 +7,10 @@
# - SC1008: This shebang was unrecognized.
# We need to skip this check when processing bats tests because the shebang
# is not a shell.
# - SC2119: Use foo "$@" if function's $1 should mean script's $1.
# We need to skip this check because in many ocassions we use functions
# that are not expecting arguments, but still shellcheck will detect this
# as error because the show_help which is called from all functions uses $@
if [ "$#" -ne 1 ]; then
cat <<-EOM
@@ -23,7 +27,7 @@ file="$1"
if [[ "${file/*./}" == "bats" ]]; then
sed 's/^@.*/func() {/' "$file" |
sed 's/^load.*/source test\/functional\/testlib.bash/' |
shellcheck -s bash -x -e SC1008 /dev/stdin
shellcheck -s bash -x -e SC1008,SC2119 /dev/stdin
else
shellcheck -x "$file"
shellcheck -x "$file" -e SC2119
fi