mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 13:32:34 +08:00
Fix #1128 - Add g:ale_linters_explicit for only enabling linters explicitly
This commit is contained in:
32
doc/ale.txt
32
doc/ale.txt
@@ -946,23 +946,25 @@ g:ale_linters *g:ale_linters*
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
The |g:ale_linters| option sets a |Dictionary| mapping a filetype
|
||||
to a |List| of linter programs to be run when checking particular filetypes.
|
||||
Only the filetypes specified in the dictionary will be limited in terms
|
||||
of which linters will be run.
|
||||
The |g:ale_linters| option sets a |Dictionary| mapping a filetype to a
|
||||
|List| of linter programs to be run when checking particular filetypes.
|
||||
|
||||
This |Dictionary| will be merged with a default dictionary containing the
|
||||
following values: >
|
||||
|
||||
{
|
||||
\ 'csh': ['shell'],
|
||||
\ 'go': ['gofmt', 'golint', 'go vet'],
|
||||
\ 'help': [],
|
||||
\ 'python': ['flake8', 'mypy', 'pylint'],
|
||||
\ 'rust': ['cargo'],
|
||||
\ 'spec': [],
|
||||
\ 'text': [],
|
||||
\ 'zsh': ['shell'],
|
||||
\}
|
||||
<
|
||||
This option can be used to enable only a particular set of linters for a
|
||||
file. For example, you can enable only 'eslint' for JavaScript files: >
|
||||
file. For example, you can enable only `eslint` for JavaScript files: >
|
||||
|
||||
let g:ale_linters = {'javascript': ['eslint']}
|
||||
<
|
||||
@@ -971,14 +973,15 @@ g:ale_linters *g:ale_linters*
|
||||
|
||||
let g:ale_linters = {'javascript': []}
|
||||
<
|
||||
All linters available for a given filetype can be enabled by using the
|
||||
string `'all'`: >
|
||||
All linters will be run for unspecified filetypes. All available linters can
|
||||
be enabled explicitly for a given filetype by passing the string `'all'`,
|
||||
instead of a List. >
|
||||
|
||||
let g:ale_linters = {'c': 'all'}
|
||||
<
|
||||
Linters can be configured in each buffer with buffer-local variables. ALE
|
||||
will first look for linters for filetypes in the `b:ale_linters` variable,
|
||||
then `g:ale_linters`, and then a default Dictionary.
|
||||
then `g:ale_linters`, and then the default Dictionary mentioned above.
|
||||
|
||||
`b:ale_linters` can be set to a List, or the string `'all'`. When linters
|
||||
for two different filetypes share the same name, the first linter loaded
|
||||
@@ -994,6 +997,19 @@ g:ale_linters *g:ale_linters*
|
||||
" Explicitly enable all available linters for the filetype.
|
||||
let b:ale_linters = 'all'
|
||||
<
|
||||
ALE can be configured to disable all linters unless otherwise specified with
|
||||
`g:ale_enabled` or `b:ale_enabled` with the option |g:ale_linters_explicit|.
|
||||
|
||||
|
||||
g:ale_linters_explicit *g:ale_linters_explicit*
|
||||
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
When set to `1`, only the linters from |g:ale_linters| and |b:ale_linters|
|
||||
will be enabled. The default behavior for ALE is to enable as many linters
|
||||
as possible, unless otherwise specified.
|
||||
|
||||
|
||||
g:ale_loclist_msg_format *g:ale_loclist_msg_format*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user