summaryrefslogtreecommitdiff
path: root/ale_linters/haskell/stack_build.vim
blob: 8f2d9fd935903166e883b8dbec5892163b51e286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
" Author: Jake Zimmerman <jake@zimmerman.io>
" Description: Like stack-ghc, but for entire projects
"
" Note: Ideally, this would *only* typecheck. Right now, it also does codegen.
" See <https://github.com/commercialhaskell/stack/issues/977>.

call ale#Set('haskell_stack_build_options', '--fast')

function! ale_linters#haskell#stack_build#GetCommand(buffer) abort
    let l:flags = ale#Var(a:buffer, 'haskell_stack_build_options')

    return 'stack build ' . l:flags
endfunction

call ale#linter#Define('haskell', {
\   'name': 'stack_build',
\   'aliases': ['stack-build'],
\   'output_stream': 'stderr',
\   'executable': function('ale#handlers#haskell#GetStackExecutable'),
\   'command': function('ale_linters#haskell#stack_build#GetCommand'),
\   'lint_file': 1,
\   'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})