no-which
What it does
Section titled “What it does”Reports a call of which.
Why it matters
Section titled “Why it matters”which is not part of POSIX, and its output and exit status differ between systems (some print an error message and exit 0). command -v is built into the shell and is portable.
To fix, write command -v name.
Example
Section titled “Example”...which git...test -f x && echo yes || echo no[ -n x ] && (a || b)a && ba || b && c...which gitConfiguration
Section titled “Configuration”shell: lint: rules: no-which: warn # off (default), warn, errorEnabled by the presets: shell/shellcheck.
Suppress one line with sudsy-disable-next-line no-which in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| shellcheck | SC2230 |
full |