diff options
author | Justin Howard <jmhoward0@gmail.com> | 2018-11-04 02:35:21 -0800 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2018-11-04 10:35:21 +0000 |
commit | 88d328739f73c98794f05fb624edf1cd4b147abe (patch) | |
tree | 9a4cae6f4d727289d9355de0dbb561996a5268df /ale_linters | |
parent | 9171791646d14d2c58ec87377e711e1116d995e5 (diff) | |
download | ale-88d328739f73c98794f05fb624edf1cd4b147abe.zip |
Allow configuration of hamllint executable (#2048)
* Allow configuration of hamllint executable
The hamllint executable was hard-coded, preventing it from being
overridden. Fix the executable to be dynamic to allow custom executable
paths.
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/haml/hamllint.vim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ale_linters/haml/hamllint.vim b/ale_linters/haml/hamllint.vim index d6633599..6598f81a 100644 --- a/ale_linters/haml/hamllint.vim +++ b/ale_linters/haml/hamllint.vim @@ -1,6 +1,12 @@ " Author: Patrick Lewis - https://github.com/patricklewis, thenoseman - https://github.com/thenoseman " Description: haml-lint for Haml files +call ale#Set('haml_hamllint_executable', 'haml-lint') + +function! ale_linters#haml#hamllint#GetExecutable(buffer) abort + return ale#Var(a:buffer, 'haml_hamllint_executable') +endfunction + function! ale_linters#haml#hamllint#GetCommand(buffer) abort let l:prefix = '' @@ -21,7 +27,7 @@ function! ale_linters#haml#hamllint#GetCommand(buffer) abort endif return (!empty(l:prefix) ? l:prefix . ' ' : '') - \ . 'haml-lint' + \ . ale_linters#haml#hamllint#GetExecutable(a:buffer) \ . (!empty(l:hamllint_config_file_path) ? ' --config ' . ale#Escape(l:hamllint_config_file_path) : '') \ . ' %t' endfunction @@ -45,7 +51,7 @@ endfunction call ale#linter#Define('haml', { \ 'name': 'hamllint', -\ 'executable': 'haml-lint', +\ 'executable_callback': 'ale_linters#haml#hamllint#GetExecutable', \ 'command_callback': 'ale_linters#haml#hamllint#GetCommand', \ 'callback': 'ale_linters#haml#hamllint#Handle' \}) |