support flags for enable/disable config

This commit is contained in:
Atsuya Takagi 2021-01-04 16:17:33 +09:00
parent 89403b4a06
commit 823b094f56

View file

@ -1,12 +1,18 @@
" Author: Atsuya Takagi <asoftonight@gmail.com> " Author: Atsuya Takagi <asoftonight@gmail.com>
" Description: A linter for Vala using Vala-Lint. " 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 function! ale_linters#vala#vala_lint#GetCommand(buffer) abort
let l:command = 'io.elementary.vala-lint ' let l:command = 'io.elementary.vala-lint '
let l:config_path = ale#path#FindNearestFile(a:buffer, 'vala-lint.conf') if ale#Var(a:buffer, 'vala_vala_lint_enable_config')
if !empty(l:config_path) let l:config_filename = ale#Var(a:buffer, 'vala_vala_lint_config_filename')
let l:command .= '-c ' . l:config_path . ' ' 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 endif
return l:command . '%s' return l:command . '%s'