Skip to content

Commit 42eeeca

Browse files
committed
refactor(ssh): remove outdated disable=SC2089,SC2090
These shellcheck directives were added in commit c906aeb (2020-04-10), but the latest version of shellcheck-0.10.0 does not seem to warn about SC2089 and SC2090 on these lines for the current version of bash_completion. These warnings seem to be issued when unquoted $_comp_cmd_scp__path_esc is used, such as echo $_comp_cmd_scp__path_esc We have already resolved those unquoted variable expansions, so the warning should no longer happen. In this patch, we remove those outdated shellcheck directives.
1 parent 4bd8b58 commit 42eeeca

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

completions/ssh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ _comp_cmd_sftp()
459459
shopt -u hostcomplete && complete -F _comp_cmd_sftp sftp
460460

461461
# things we want to backslash escape in scp paths
462-
# shellcheck disable=SC2089
463462
_comp_cmd_scp__path_esc='[][(){}<>"'"'"',:;^&!$=?`\\|[:space:]]'
464463

465464
# Complete remote files with ssh. Returns paths escaped with three backslashes
@@ -493,7 +492,6 @@ _comp_xfunc_scp_compgen_remote_files()
493492
local _path=${cur#*:}
494493

495494
# unescape (3 backslashes to 1 for chars we escaped)
496-
# shellcheck disable=SC2090
497495
_path=$(command sed -e 's/\\\\\\\('"$_comp_cmd_scp__path_esc"'\)/\\\1/g' <<<"$_path")
498496

499497
# default to home dir of specified user on remote host
@@ -509,14 +507,12 @@ _comp_xfunc_scp_compgen_remote_files()
509507
local _files
510508
if [[ $_dirs_only ]]; then
511509
# escape problematic characters; remove non-dirs
512-
# shellcheck disable=SC2090
513510
_files=$(ssh -o 'Batchmode yes' "$_userhost" \
514511
command ls -aF1dL "$_path*" 2>/dev/null |
515512
command sed -e 's/'"$_comp_cmd_scp__path_esc"'/'"$_escape_replacement"'/g' -e '/[^/]$/d')
516513
else
517514
# escape problematic characters; remove executables, aliases, pipes
518515
# and sockets; add space at end of file names
519-
# shellcheck disable=SC2090
520516
_files=$(ssh -o 'Batchmode yes' "$_userhost" \
521517
command ls -aF1dL "$_path*" 2>/dev/null |
522518
command sed -e 's/[*@|=]$//g' \

0 commit comments

Comments
 (0)