This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/doc/ale-sh.txt
Kevin Locke a0d4eb3699 Support ale_sh_shellcheck_dialect to set dialect
As discussed in w0rp/ale#1051, there are cases where it would be useful
to be able to specify the dialect explicitly.  This commit allows users
to do so using the ale_sh_shellcheck_dialect variable.

Fixes: w0rp/ale#1051

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2019-02-10 09:00:55 -07:00

103 lines
4 KiB
Text

===============================================================================
ALE Shell Integration *ale-sh-options*
===============================================================================
sh-language-server *ale-sh-language-server*
g:ale_sh_language_server_executable *g:ale_sh_language_server_executable*
*b:ale_sh_language_server_executable*
Type: |String|
Default: `'bash-language-server'`
See |ale-integrations-local-executables|
g:ale_sh_language_server_use_global *g:ale_sh_language_server_use_global*
*b:ale_sh_language_server_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
===============================================================================
shell *ale-sh-shell*
g:ale_sh_shell_default_shell *g:ale_sh_shell_default_shell*
*b:ale_sh_shell_default_shell*
Type: |String|
Default: The current shell (`$SHELL`). Falls back to `'bash'` if that cannot be
read or if the current shell is `'fish'`.
When ALE runs the linter for shells with the `-n` flag, it will attempt to
read the shell from the shebang (`#!`) line from the shell script to
determine the shell program to run. When this detection fails, this variable
will be used instead.
===============================================================================
shellcheck *ale-sh-shellcheck*
g:ale_sh_shellcheck_executable *g:ale_sh_shellcheck_executable*
*b:ale_sh_shellcheck_executable*
Type: |String|
Default: `'shellcheck'`
This variable sets executable used for shellcheck.
g:ale_sh_shellcheck_options *g:ale_sh_shellcheck_options*
*b:ale_sh_shellcheck_options*
Type: |String|
Default: `''`
With this variable we are able to pass extra arguments for shellcheck
for shellcheck invocation.
For example, if we want shellcheck to follow external sources (`see SC1091`)
we can set the variable as such:
>
let g:ale_sh_shellcheck_options = '-x'
<
g:ale_sh_shellcheck_dialect *g:ale_sh_shellcheck_dialect*
*b:ale_sh_shellcheck_dialect*
Type: |String|
Default: `'auto'`
This variable specifies the shellcheck dialect (`-s` option). The value
`'auto'` causes ALE to detect the dialect automatically, based on the shebang
line (if present) or the value of `b:is_bash`, `b:is_sh`, or `b:is_kornshell`
(set and used by |sh.vim|).
g:ale_sh_shellcheck_exclusions *g:ale_sh_shellcheck_exclusions*
*b:ale_sh_shellcheck_exclusions*
Type: |String|
Default: `''`
Set this variable to exclude test(s) for shellcheck (-e/--exclude option).
To exclude more than one option, separate them with commas.
For example, to ignore some warnings that aren't applicable to files that
will be sourced by other scripts, use the buffer-local variant:
>
autocmd BufEnter PKGBUILD,.env
\ let b:ale_sh_shellcheck_exclusions = 'SC2034,SC2154,SC2164'
<
===============================================================================
shfmt *ale-sh-shfmt*
g:ale_sh_shfmt_options *g:ale_sh_shfmt_options*
*b:ale_sh_shfmt_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the shfmt fixer.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: