summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorAlex Masterov <alex.masterow@gmail.com>2017-02-15 11:12:24 +0300
committerAlex Masterov <alex.masterow@gmail.com>2017-02-15 11:36:16 +0300
commit7ef1d485fedd3ea44e48fb44b494ff2698247d5d (patch)
tree6305468115ca801a9c0796977dfc874da109301b /ale_linters
parent4e082b9217e95c442bc3fab1a7ea55a26ef8703e (diff)
downloadale-7ef1d485fedd3ea44e48fb44b494ff2698247d5d.zip
Add yamllint option to pass in more options
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/yaml/yamllint.vim20
1 files changed, 18 insertions, 2 deletions
diff --git a/ale_linters/yaml/yamllint.vim b/ale_linters/yaml/yamllint.vim
index 0a1ca7d0..236c3492 100644
--- a/ale_linters/yaml/yamllint.vim
+++ b/ale_linters/yaml/yamllint.vim
@@ -1,5 +1,21 @@
" Author: KabbAmine <amine.kabb@gmail.com>
+let g:ale_yaml_yamllint_executable =
+\ get(g:, 'ale_yaml_yamllint_executable', 'yamllint')
+
+let g:ale_yaml_yamllint_options =
+\ get(g:, 'ale_yaml_yamllint_options', '')
+
+function! ale_linters#yaml#yamllint#GetExecutable(buffer) abort
+ return g:ale_yaml_yamllint_executable
+endfunction
+
+function! ale_linters#yaml#yamllint#GetCommand(buffer) abort
+ return ale_linters#yaml_yamllint#GetExecutable(a:buffer)
+ \ . ' ' . g:ale_yaml_yamllint_options
+ \ . ' -f parsable %t'
+endfunction
+
function! ale_linters#yaml#yamllint#Handle(buffer, lines) abort
" Matches patterns line the following:
" something.yaml:1:1: [warning] missing document start "---" (document-start)
@@ -36,7 +52,7 @@ endfunction
call ale#linter#Define('yaml', {
\ 'name': 'yamllint',
-\ 'executable': 'yamllint',
-\ 'command': 'yamllint -f parsable %t',
+\ 'executable_callback': 'ale_linters#yaml#yamllint#GetExecutable',
+\ 'command_callback': 'ale_linters#yaml#yamllint#GetCommand',
\ 'callback': 'ale_linters#yaml#yamllint#Handle',
\})