summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorJake Zimmerman <zimmerman.jake@gmail.com>2017-07-11 07:05:13 -0500
committerw0rp <w0rp@users.noreply.github.com>2017-07-11 13:05:13 +0100
commit768f761017e4d67d8724684df874006d5b04147d (patch)
treed7be5238419ab11313ded9edd06d73547ec578e5 /ale_linters
parent05d3bb12ddea96b8f93b6e06eea94c4969dc5c72 (diff)
downloadale-768f761017e4d67d8724684df874006d5b04147d.zip
Prefer --fast for stack-build (#754)
* Vim scripts shouldn't have hyphens Especially not ones that will be autoloaded. You can't have a hyphen in a function name, so autoloading functions based on filename will fail. * Add g:haskell_stack_build_options, default: --fast If we're going to use the --fast option, we may as well go the whole 9 yards and let the user configure the 'stack build' flags. * Create documentation for stack-build options
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/haskell/stack_build.vim (renamed from ale_linters/haskell/stack-build.vim)10
-rw-r--r--ale_linters/haskell/stack_ghc.vim (renamed from ale_linters/haskell/stack-ghc.vim)0
2 files changed, 9 insertions, 1 deletions
diff --git a/ale_linters/haskell/stack-build.vim b/ale_linters/haskell/stack_build.vim
index 1c2a06f6..525fd3fb 100644
--- a/ale_linters/haskell/stack-build.vim
+++ b/ale_linters/haskell/stack_build.vim
@@ -4,11 +4,19 @@
" 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',
\ 'output_stream': 'stderr',
\ 'executable': 'stack',
-\ 'command': 'stack build',
+\ 'command_callback': 'ale_linters#haskell#stack_build#GetCommand',
\ 'lint_file': 1,
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})
diff --git a/ale_linters/haskell/stack-ghc.vim b/ale_linters/haskell/stack_ghc.vim
index 0367dc24..0367dc24 100644
--- a/ale_linters/haskell/stack-ghc.vim
+++ b/ale_linters/haskell/stack_ghc.vim