-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
For new checks and feature suggestions
- https://www.shellcheck.net/ (i.e. the latest commit) currently gives no useful warnings about this
- I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related (the closest is Is there a way for shellcheck to understand custom aliases? #1132)
In the example provided below, info essentially behaves like printf in terms of argument processing, so I would expect to have an option to say "info is basically printf with a different name" to shellcheck
Here's a snippet or screenshot that shows the problem:
#!/bin/sh
name="alice"
info() {
printf '\x1b[2m'
# shellcheck disable=SC2059 # intentional
printf "$@"
printf '\x1b[m'
}
info "hello $name"Here's what shellcheck currently says:
No issues detected!
Here's what I wanted or expected to see:
Line 12:
info "hello $name"
^-- SC2059 (info): Don't use variables in the info format string. Use info '..%s..' "$foo".
Metadata
Metadata
Assignees
Labels
No labels