Merge pull request #9 from prashcr/master
Add option for choosing linters to run
This commit is contained in:
commit
a39274d7f4
1 changed files with 15 additions and 0 deletions
|
@ -7,6 +7,10 @@ let g:loaded_ale_zmain = 1
|
||||||
let s:lint_timer = -1
|
let s:lint_timer = -1
|
||||||
let s:linters = {}
|
let s:linters = {}
|
||||||
|
|
||||||
|
if !exists('g:ale_linters')
|
||||||
|
let g:ale_linters = {}
|
||||||
|
endif
|
||||||
|
|
||||||
" Stores information for each job including:
|
" Stores information for each job including:
|
||||||
"
|
"
|
||||||
" linter: The linter dictionary for the job.
|
" linter: The linter dictionary for the job.
|
||||||
|
@ -262,6 +266,17 @@ function! ALEGetLinters(filetype)
|
||||||
return []
|
return []
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if has_key(g:ale_linters, a:filetype)
|
||||||
|
let linters = []
|
||||||
|
" Filter loaded linters according to list of linters specified in option
|
||||||
|
for linter in s:linters[a:filetype]
|
||||||
|
if index(g:ale_linters[a:filetype], linter.name) != -1
|
||||||
|
call add(linters, linter)
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
return linters
|
||||||
|
endif
|
||||||
|
|
||||||
return s:linters[a:filetype]
|
return s:linters[a:filetype]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
Reference in a new issue