-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Describe the bug
A clear and concise description of what the bug is. Include version by typing gh --version.
(installed from dnf:)
gh version 2.27.0 (2023-04-11)
https://github.com/cli/cli/releases/tag/v2.27.0
- line 26, so-called "useless" cat
- line 27, three unquoted variable expansions
Steps to reproduce the behavior
- Type this '...'
In Fedora,
sudo dnf -y install git ShellCheck gh
Distro agnositc,
git clone 'https://github.com/cli/cli'; find . \! -path '*cli/.git/*' \! -empty -type f -exec file -kp '{}' ';' | grep Bourne > /tmp/gh-scripts; mapfile -t ghs < <(cut -d':' -f1 /tmp/gh-scripts); for s in "${ghs[@]}"; do printf '%-50s' "$s"; grep -Eve ^'\s*#' "$s" | wc; done | sort -grk2; shellcheck ./cli/internal/codespaces/rpc/generate.sh
- View the output '....'
In ./cli/internal/codespaces/rpc/generate.sh line 26:
services=$(cat "$contract" | grep -Eo "service .+ {" | awk '{print $2 "Server"}')
^---------^ SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
In ./cli/internal/codespaces/rpc/generate.sh line 27:
moq -out $contract.mock.go $dir $services
^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
moq -out "$contract".mock.go "$dir" "$services"
For more information:
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
https://www.shellcheck.net/wiki/SC2002 -- Useless cat. Consider 'cmd < file...