mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-06 21:51:32 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user