Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a directive for treating a command as an alias of another command #3060

Open
2 tasks done
thecaralice opened this issue Sep 22, 2024 · 0 comments
Open
2 tasks done

Comments

@thecaralice
Copy link

thecaralice commented Sep 22, 2024

For new checks and feature suggestions

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".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant