-
Notifications
You must be signed in to change notification settings - Fork 2
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
How to keep ShellCheck happy ? #8
Comments
https://github.com/koalaman/shellcheck/wiki/SC2154#exceptions Seems like the viable workarounds are:
Sadly this problem can't be solved from the "slap side". The only possible workaround I can think of is to export an hash-map instead of multiple variables, in which case you would need only one directive (for the hash-map), and not for its values. This is possible to implement for shells like BASH and ZSH, but some shells don't support this, most notably the POSIX sh standard. I would like to have the option to export as an hash-map for shells that support hash-maps, so in the future it will be added. For now the user has to choose from one of the four workarounds before-mentioned. I'm going to add a section to the README, thank you. |
Thanks for your thoughts !
Oh, I didn't know that was possible. Putting the directive right after the |
Running ShellCheck against a "slapped" script produces one warning per variable ; for instance:
How could we silent ShellCheck when using Slap ?
The only way I could think of is to add
# shellcheck disable=SC2154
below the shebang ; but doing so will prevent further errors with non-slap variables from being reported.
Any thoughts ?
The text was updated successfully, but these errors were encountered: