2018-03-31 10:55:20 -04:00
|
|
|
" Author: rob-b, Takano Akio <tak@anoak.io>
|
|
|
|
" Description: hdevtools for Haskell files
|
|
|
|
|
|
|
|
call ale#Set('haskell_hdevtools_executable', 'hdevtools')
|
2018-06-14 06:31:12 -04:00
|
|
|
call ale#Set('haskell_hdevtools_options', get(g:, 'hdevtools_options', '-g -Wall'))
|
2018-03-31 10:55:20 -04:00
|
|
|
|
|
|
|
function! ale_linters#haskell#hdevtools#GetCommand(buffer) abort
|
2018-09-30 16:58:57 -04:00
|
|
|
let l:executable = ale#Var(a:buffer, 'haskell_hdevtools_executable')
|
|
|
|
|
|
|
|
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hdevtools')
|
|
|
|
\ . ' check' . ale#Pad(ale#Var(a:buffer, 'haskell_hdevtools_options'))
|
2018-08-25 12:13:42 -04:00
|
|
|
\ . ' -p %s %t'
|
2018-03-31 10:55:20 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('haskell', {
|
|
|
|
\ 'name': 'hdevtools',
|
2019-03-08 06:04:56 -05:00
|
|
|
\ 'executable': {b -> ale#Var(b, 'haskell_hdevtools_executable')},
|
|
|
|
\ 'command': function('ale_linters#haskell#hdevtools#GetCommand'),
|
2018-03-31 10:55:20 -04:00
|
|
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
|
|
|
\})
|