summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2019-01-27 10:20:46 +0000
committerGitHub <noreply@github.com>2019-01-27 10:20:46 +0000
commitdd995d9aa9ec950fdf307cad39487e29abd5ee49 (patch)
tree2cf4a44fb7aebff8eed34b9d9a23eb7dbb33a967 /ale_linters
parent6288c8b08e360c787e0b41daaf21e06d6da0512a (diff)
parente273f678fffe190ba3b22995ca8d91ab60fcf88d (diff)
downloadale-dd995d9aa9ec950fdf307cad39487e29abd5ee49.zip
Merge pull request #2235 from erydo/stack-ghc-options
Add g:haskell_stack_ghc_options like …_cabal_ghc_…
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/haskell/stack_ghc.vim11
1 files changed, 10 insertions, 1 deletions
diff --git a/ale_linters/haskell/stack_ghc.vim b/ale_linters/haskell/stack_ghc.vim
index 8f42b96c..99aa2540 100644
--- a/ale_linters/haskell/stack_ghc.vim
+++ b/ale_linters/haskell/stack_ghc.vim
@@ -1,11 +1,20 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: ghc for Haskell files, using Stack
+call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
+
+function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
+ return ale#handlers#haskell#GetStackExecutable(a:buffer)
+ \ . ' ghc -- '
+ \ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
+ \ . ' %t'
+endfunction
+
call ale#linter#Define('haskell', {
\ 'name': 'stack_ghc',
\ 'aliases': ['stack-ghc'],
\ 'output_stream': 'stderr',
\ 'executable_callback': 'ale#handlers#haskell#GetStackExecutable',
-\ 'command': 'stack ghc -- -fno-code -v0 %t',
+\ 'command_callback': 'ale_linters#haskell#stack_ghc#GetCommand',
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})