summaryrefslogtreecommitdiff
path: root/ale_linters/vala/vala_lint.vim
diff options
context:
space:
mode:
authorAtsuya Takagi <asoftonight@gmail.com>2021-01-04 16:17:33 +0900
committerAtsuya Takagi <asoftonight@gmail.com>2021-01-23 00:08:01 +0900
commit823b094f5618c9dd53a0a56bbf131ed077f4105b (patch)
treeabf5d58a2f83cc572dddcef32c9ef93ed260d5ad /ale_linters/vala/vala_lint.vim
parent89403b4a0600011ad94d51a7aef9e26afe284fd6 (diff)
downloadale-823b094f5618c9dd53a0a56bbf131ed077f4105b.zip
support flags for enable/disable config
Diffstat (limited to 'ale_linters/vala/vala_lint.vim')
-rw-r--r--ale_linters/vala/vala_lint.vim12
1 files changed, 9 insertions, 3 deletions
diff --git a/ale_linters/vala/vala_lint.vim b/ale_linters/vala/vala_lint.vim
index a38bf9bf..24ade378 100644
--- a/ale_linters/vala/vala_lint.vim
+++ b/ale_linters/vala/vala_lint.vim
@@ -1,12 +1,18 @@
" Author: Atsuya Takagi <asoftonight@gmail.com>
" Description: A linter for Vala using Vala-Lint.
+let g:ale_vala_vala_lint_enable_config = get(g:, 'ale_vala_vala_lint_enable_config', 0)
+let g:ale_vala_vala_lint_config_filename = get(g:, 'ale_vala_vala_lint_config_filename', 'vala-lint.conf')
+
function! ale_linters#vala#vala_lint#GetCommand(buffer) abort
let l:command = 'io.elementary.vala-lint '
- let l:config_path = ale#path#FindNearestFile(a:buffer, 'vala-lint.conf')
- if !empty(l:config_path)
- let l:command .= '-c ' . l:config_path . ' '
+ if ale#Var(a:buffer, 'vala_vala_lint_enable_config')
+ let l:config_filename = ale#Var(a:buffer, 'vala_vala_lint_config_filename')
+ let l:config_path = ale#path#FindNearestFile(a:buffer, l:config_filename)
+ if !empty(l:config_path)
+ let l:command .= '-c ' . l:config_path . ' '
+ endif
endif
return l:command . '%s'