summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/cpp/clang.vim2
-rw-r--r--ale_linters/yaml/yamllint.vim20
2 files changed, 19 insertions, 3 deletions
diff --git a/ale_linters/cpp/clang.vim b/ale_linters/cpp/clang.vim
index 8ae48bc4..9c2c73cf 100644
--- a/ale_linters/cpp/clang.vim
+++ b/ale_linters/cpp/clang.vim
@@ -13,7 +13,7 @@ call ale#linter#Define('cpp', {
\ 'name': 'clang',
\ 'output_stream': 'stderr',
\ 'executable': 'clang++',
-\ 'command': 'clang++ -S -x c -fsyntax-only '
+\ 'command': 'clang++ -S -x c++ -fsyntax-only '
\ . g:ale_cpp_clang_options
\ . ' -',
\ 'callback': 'ale#handlers#HandleGCCFormat',
diff --git a/ale_linters/yaml/yamllint.vim b/ale_linters/yaml/yamllint.vim
index 0a1ca7d0..42006fb4 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',
\})