summaryrefslogtreecommitdiff
path: root/ale_linters/haskell/cabal_ghc.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/haskell/cabal_ghc.vim')
-rw-r--r--ale_linters/haskell/cabal_ghc.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/ale_linters/haskell/cabal_ghc.vim b/ale_linters/haskell/cabal_ghc.vim
new file mode 100644
index 00000000..003adf5d
--- /dev/null
+++ b/ale_linters/haskell/cabal_ghc.vim
@@ -0,0 +1,19 @@
+" Author: Eric Wolf <ericwolf42@gmail.com>
+" Description: ghc for Haskell files called with cabal exec
+
+call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
+
+function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort
+ return 'cabal exec -- ghc '
+ \ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
+ \ . ' %t'
+endfunction
+
+call ale#linter#Define('haskell', {
+\ 'name': 'cabal_ghc',
+\ 'aliases': ['cabal-ghc'],
+\ 'output_stream': 'stderr',
+\ 'executable': 'cabal',
+\ 'command_callback': 'ale_linters#haskell#cabal_ghc#GetCommand',
+\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
+\})