SublimeLinter / SublimeLinter-shellcheck

This linter plugin for SublimeLinter provides an interface to shellcheck.
MIT License
210 stars 20 forks source link

set shell for embedded script #16

Open braver opened 6 years ago

braver commented 6 years ago

via https://github.com/SublimeLinter/SublimeLinter/issues/1446

Ok, so the primary thing that stops shellcheck from running on embedded code is that it can't determine what shell the script is for. So, the solution is to have a setting for shellcheck that sets the shell via an arg when the root scope isn't source.sh.

nicodeceulaer commented 6 years ago

As described here: https://github.com/koalaman/shellcheck/wiki/SC2148 this would be fixed by allowing sublimelinter-shellcheck to provide a default shell (using the -s command line option)?

braver commented 6 years ago

-s doesn't provide a "default" but sets the value it will use regardless of the shebang. So you use one or the other. If I understand this correctly, it will use a reasonable default by itself, so we could also suppress the warning.