-
Notifications
You must be signed in to change notification settings - Fork 128
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
Ignore zsh files in shellcheck #689
Comments
That is a really good point. We could also use the shebang, which we are currently parsing. Note that the treesitter parser we are using isn't really supporting zsh either. #252 Let me know if you want to help out fixing this issue. |
Thanks for the detailed report! That does make a lot of sense. A fix should be out within the next hour. Let us know if you have other suggestions. |
Thank you! |
Using vscode 1.75.0 on linux with Bash IDE 1.35.0, this problem can be reproduced. foo.zsh #!/usr/bin/env zsh
source somestuff This triggers the bash-language-server into showing a problem on the
The Bash IDE glob pattern i have is the default one:
|
The error here has nothing to do with shellcheck, but is caused by us not being able to follow the source command. But we do use the shellcheck directive to guide us understanding the source command. I understand that this can be confusing. Any idea on how to improve this? If we remove the diagnostic/error, then the user might not understand why jump to definition, documentation etc doesn’t work across the sourced file. |
If this message would show up in a bash script, that would be fine (although i thought that shellcheck did run). It is my understanding zsh scripts are not supported by the Bash IDE, so i do not expect it to run at all. I took the source only as an example to show the Bash IDE is running on a script where i do not expect the Bash IDE to run on. |
well the support is not great, but it does a decent job for a lot of simpler zsh scripts. But we could disable this specific error for zsh files. Note that the language server is called for any 🐚-scripts and we just try to be helpful in return. Official zsh support is covered in #252 |
Code editor
Visual Studio Code
Platform
Linux
Version
v1.29.0
What steps will reproduce the bug?
Open
.zshrc
or a file with the.zsh
extensionHow often does it reproduce? Is there a required condition?
The language is configured as Shell Script (shellscript). This is default behaviour in VSCode.
What is the expected behavior?
Nothing
What do you see instead?
It’s checked by Shellcheck, which can’t handle ZSH syntax. This results in a lot of errors.
Additional information
The solution would be to ignore validation of
.zshrc
and*.zsh
files.The text was updated successfully, but these errors were encountered: