summaryrefslogtreecommitdiff
path: root/autoload/ale.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-06-24 21:16:45 +0100
committerw0rp <devw0rp@gmail.com>2018-06-24 21:16:45 +0100
commit620951b6d3420ca69754f3e1068167729d8c651b (patch)
tree2880dce657ca750d3a6179420d655f00136b46fd /autoload/ale.vim
parent755f1a4ccfff28463b0fe30f74a97390ae59d1fa (diff)
downloadale-620951b6d3420ca69754f3e1068167729d8c651b.zip
Close #1453 #1172 - Add ale_linters_ignore for ignoring linter results
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r--autoload/ale.vim11
1 files changed, 10 insertions, 1 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim
index 205a5abb..dcc12150 100644
--- a/autoload/ale.vim
+++ b/autoload/ale.vim
@@ -6,6 +6,8 @@
let g:ale_echo_msg_error_str = get(g:, 'ale_echo_msg_error_str', 'Error')
let g:ale_echo_msg_info_str = get(g:, 'ale_echo_msg_info_str', 'Info')
let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning')
+" Ignoring linters, for disabling some, or ignoring LSP diagnostics.
+let g:ale_linters_ignore = get(g:, 'ale_linters_ignore', {})
let s:lint_timer = -1
let s:queued_buffer_number = -1
@@ -150,7 +152,8 @@ function! ale#Lint(...) abort
endif
" Use the filetype from the buffer
- let l:linters = ale#linter#Get(getbufvar(l:buffer, '&filetype'))
+ let l:filetype = getbufvar(l:buffer, '&filetype')
+ let l:linters = ale#linter#Get(l:filetype)
let l:should_lint_file = 0
" Check if we previously requested checking the file.
@@ -160,6 +163,12 @@ function! ale#Lint(...) abort
let l:should_lint_file = filereadable(expand('#' . l:buffer . ':p'))
endif
+ " Apply ignore lists for linters only if needed.
+ let l:ignore_config = ale#Var(l:buffer, 'linters_ignore')
+ let l:linters = !empty(l:ignore_config)
+ \ ? ale#engine#ignore#Exclude(l:filetype, l:linters, l:ignore_config)
+ \ : l:linters
+
call ale#engine#RunLinters(l:buffer, l:linters, l:should_lint_file)
endfunction