-
Notifications
You must be signed in to change notification settings - Fork 132
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
The "shell" directive has no effect in a shell script file #929
Comments
After diving a bit into the code, i can see that the I must admit that I don't understand why the language server need to detect the shell dialect instead of letting shellcheck do its job. There is a comment that attempt to give a rationale:
However I don't understand the argument here: if the user want his shell script to be interpreted as a bash script, he can either add a shebang or use a shellcheck directive, right? |
PR are more than welcome here. The current behaviour is not perfect, but does enable people to use ShellCheck for bash-like without adding directives. We can either include parsing directives when guessing the dialect OR simply remove the feature to enable parsing files with a bash syntax. Also the support for enabling parsing files with a bash syntax was added before the directive parser (PR). |
Code editor
Sublime Text
Platform
Windows, Linux
Version
5.0.0
What steps will reproduce the bug?
The following script raises a shellcheck warning on the "set" line:
However it should not because I explicitly defined the shell to eliminate the warning.
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
I would expect the shell directive to be taken into account, so no warning should appear on the "set" line
What do you see instead?
The shell directive is ignored
Additional information
I suspect that the problem is caused by the LSP language server passing the
--shell
option to the command-line which have the priority over the shell directive defined in my script file. But, AFAIK, there's no way to change/remove the value of the--shell
option, right?The text was updated successfully, but these errors were encountered: