summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-01-02 14:05:40 +0000
committerGitHub <noreply@github.com>2018-01-02 14:05:40 +0000
commit5285b0b332f067f56a6ac13a316db64acbac0c6b (patch)
tree40a372a0a15d8500f59e3d56ed764997abcbc1a7
parente98a3899da6852026eab2356cd7a1cbc470aef09 (diff)
parent681c35169f7b8a71c311902d9e530a3e5906648f (diff)
downloadale-5285b0b332f067f56a6ac13a316db64acbac0c6b.zip
Merge pull request #1260 from kevinkjt2000/add-ghc-options
haskell_ghc_options are now added to the ghc command
-rw-r--r--ale_linters/haskell/ghc.vim10
-rw-r--r--doc/ale-haskell.txt10
-rw-r--r--doc/ale.txt1
3 files changed, 20 insertions, 1 deletions
diff --git a/ale_linters/haskell/ghc.vim b/ale_linters/haskell/ghc.vim
index fdf22f9f..daf91c8f 100644
--- a/ale_linters/haskell/ghc.vim
+++ b/ale_linters/haskell/ghc.vim
@@ -1,10 +1,18 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: ghc for Haskell files
+call ale#Set('haskell_ghc_options', '-fno-code -v0')
+
+function! ale_linters#haskell#ghc#GetCommand(buffer) abort
+ return 'ghc '
+ \ . ale#Var(a:buffer, 'haskell_ghc_options')
+ \ . ' %t'
+endfunction
+
call ale#linter#Define('haskell', {
\ 'name': 'ghc',
\ 'output_stream': 'stderr',
\ 'executable': 'ghc',
-\ 'command': 'ghc -fno-code -v0 %t',
+\ 'command_callback': 'ale_linters#haskell#ghc#GetCommand',
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})
diff --git a/doc/ale-haskell.txt b/doc/ale-haskell.txt
index 0ea40377..9fab39bf 100644
--- a/doc/ale-haskell.txt
+++ b/doc/ale-haskell.txt
@@ -13,6 +13,16 @@ g:ale_haskell_brittany_executable *g:ale_haskell_brittany_executable*
This variable can be changed to use a different executable for brittany.
===============================================================================
+ghc *ale-haskell-ghc*
+
+g:ale_haskell_ghc_options *g:ale_haskell_ghc_options*
+ *b:ale_haskell_ghc_options*
+ Type: |String|
+ Default: `'-fno-code -v0'`
+
+ This variable can be changed to modify flags given to ghc.
+
+===============================================================================
hdevtools *ale-haskell-hdevtools*
g:ale_haskell_hdevtools_executable *g:ale_haskell_hdevtools_executable*
diff --git a/doc/ale.txt b/doc/ale.txt
index a7d53b0c..53b19b3e 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -85,6 +85,7 @@ CONTENTS *ale-contents*
ember-template-lint.................|ale-handlebars-embertemplatelint|
haskell...............................|ale-haskell-options|
brittany............................|ale-haskell-brittany|
+ ghc.................................|ale-haskell-ghc|
hdevtools...........................|ale-haskell-hdevtools|
hfmt................................|ale-haskell-hfmt|
stack-build.........................|ale-haskell-stack-build|