From 5fa3ef7020ca96ca5577016c845db6c13caa8eea Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 7 Dec 2018 01:08:03 +1300 Subject: Disable shellcheck rules for missed definition These two arrays are both defined by `read -a`. --- bash/bash_completion.d/make.bash | 2 +- bash/bash_completion.d/path.bash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/bash_completion.d/make.bash b/bash/bash_completion.d/make.bash index 7f8b8125..909c52fb 100644 --- a/bash/bash_completion.d/make.bash +++ b/bash/bash_completion.d/make.bash @@ -34,11 +34,11 @@ _make() { esac # Break the target up with space delimiters - declare -a targets IFS=' ' read -a targets -r \ < <(printf '%s\n' "${line%%:*}") # Short-circuit if there are no targets + # shellcheck disable=SC2154 ((${#targets[@]})) || exit # Make matches behave correctly diff --git a/bash/bash_completion.d/path.bash b/bash/bash_completion.d/path.bash index 9234f132..c3bb7b80 100644 --- a/bash/bash_completion.d/path.bash +++ b/bash/bash_completion.d/path.bash @@ -62,11 +62,11 @@ _path() { fi # Break PATH into parts - declare -a paths IFS=: read -a paths -d '' -r \ < <(printf '%s\0' "$PATH") # Print shell-quoted matching parts, null-terminated + # shellcheck disable=SC2154 for path in "${paths[@]}" ; do case $path in ("$2"*) printf '%q\0' "$path" ;; -- cgit v1.2.3