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

Bug: shellcheck fails for .zsh files #4100

Closed
ds2606 opened this issue Mar 4, 2022 · 2 comments
Closed

Bug: shellcheck fails for .zsh files #4100

ds2606 opened this issue Mar 4, 2022 · 2 comments
Labels

Comments

@ds2606
Copy link

ds2606 commented Mar 4, 2022

Shellcheck does not recognize zsh, and fails (exit code 4) when ALE attempts to execute shellcheck -s zsh on .zsh files, giving no output.

Currently I made a hotfix in my local build by hardcoding the dialect to bash in autoload/handlers/shellcheck.vim

I don't know ALE well enough to make a PR, but it seems that l:possible_shell should be restricted to valid dialects recognized by shellcheck: sh, bash, dash, and ksh.

Currently line 10 reads:

 let l:possible_shell = ['bash', 'dash', 'ash', 'tcsh', 'csh', 'zsh', 'ksh', 'sh']

Therefore, it seems that tcsh, csh, zsh and ash need to be removed in order to prevent shellcheck failure in ALE for zsh (and presumably also the other aforementioned invalid dialects).

@ds2606 ds2606 added the bug label Mar 4, 2022
@w0rp
Copy link
Member

w0rp commented Mar 5, 2022

shellcheck doesn't really support zsh. See this issue: koalaman/shellcheck#809

You can set ale_sh_shellcheck_dialect to 'bash' and it will work on most zsh code where it doesn't differ from Bash.

@ds2606
Copy link
Author

ds2606 commented Mar 5, 2022

thanks w0rp!

@ds2606 ds2606 closed this as completed Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants