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

lint: treat bash as sh #4888

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benknoble
Copy link
Contributor

Vim version 9.1.0965 1 in commit b9b762c21f (patch 9.1.0965: filetype: sh filetype set when detecting the use of bash, 2024-12-27) broke out bash as a standalone filetype (whose runtime support already redirects through the shell runtime support).

As a consequence, ALE didn't lint filetype=bash well. Teach it to consider bash an alias of sh (until and unless it is desirable to have bash-specific linters, at which point we may need to duplicate some linters like shellcheck or find another way to mark them enabled for bash).

Something like

runtime! ale_linters/sh/*.vim

in ale_linters/bash/redirect_to_sh.vim doesn't work because the linters are defined with ale#linter#Define('sh', …).

Vim version 9.1.0965 [1] in commit b9b762c21f (patch 9.1.0965: filetype:
sh filetype set when detecting the use of bash, 2024-12-27) broke out
bash as a standalone filetype (whose runtime support already redirects
through the shell runtime support).

As a consequence, ALE didn't lint filetype=bash well. Teach it to
consider bash an alias of sh (until and unless it is desirable to have
bash-specific linters, at which point we may need to duplicate some
linters like shellcheck or find another way to mark them enabled for
bash).

Something like

    runtime! ale_linters/sh/*.vim

in `ale_linters/bash/redirect_to_sh.vim` doesn't work because the
linters are defined with ale#linter#Define('sh', …).

[1]: vim/vim@b9b762c
@benknoble
Copy link
Contributor Author

I believe the Vim patch has also landed in Neovim.

@saccarosium
Copy link

I believe the Vim patch has also landed in Neovim.

Indeed it landed with: neovim/neovim#31749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants