From 768f761017e4d67d8724684df874006d5b04147d Mon Sep 17 00:00:00 2001 From: Jake Zimmerman Date: Tue, 11 Jul 2017 07:05:13 -0500 Subject: 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 --- ale_linters/haskell/stack-build.vim | 14 -------------- ale_linters/haskell/stack-ghc.vim | 10 ---------- ale_linters/haskell/stack_build.vim | 22 ++++++++++++++++++++++ ale_linters/haskell/stack_ghc.vim | 10 ++++++++++ 4 files changed, 32 insertions(+), 24 deletions(-) delete mode 100644 ale_linters/haskell/stack-build.vim delete mode 100644 ale_linters/haskell/stack-ghc.vim create mode 100644 ale_linters/haskell/stack_build.vim create mode 100644 ale_linters/haskell/stack_ghc.vim (limited to 'ale_linters') diff --git a/ale_linters/haskell/stack-build.vim b/ale_linters/haskell/stack-build.vim deleted file mode 100644 index 1c2a06f6..00000000 --- a/ale_linters/haskell/stack-build.vim +++ /dev/null @@ -1,14 +0,0 @@ -" Author: Jake Zimmerman -" Description: Like stack-ghc, but for entire projects -" -" Note: Ideally, this would *only* typecheck. Right now, it also does codegen. -" See . - -call ale#linter#Define('haskell', { -\ 'name': 'stack-build', -\ 'output_stream': 'stderr', -\ 'executable': 'stack', -\ 'command': 'stack build', -\ 'lint_file': 1, -\ 'callback': 'ale#handlers#haskell#HandleGHCFormat', -\}) diff --git a/ale_linters/haskell/stack-ghc.vim b/ale_linters/haskell/stack-ghc.vim deleted file mode 100644 index 0367dc24..00000000 --- a/ale_linters/haskell/stack-ghc.vim +++ /dev/null @@ -1,10 +0,0 @@ -" Author: w0rp -" Description: ghc for Haskell files, using Stack - -call ale#linter#Define('haskell', { -\ 'name': 'stack-ghc', -\ 'output_stream': 'stderr', -\ 'executable': 'stack', -\ 'command': 'stack ghc -- -fno-code -v0 %t', -\ 'callback': 'ale#handlers#haskell#HandleGHCFormat', -\}) diff --git a/ale_linters/haskell/stack_build.vim b/ale_linters/haskell/stack_build.vim new file mode 100644 index 00000000..525fd3fb --- /dev/null +++ b/ale_linters/haskell/stack_build.vim @@ -0,0 +1,22 @@ +" Author: Jake Zimmerman +" Description: Like stack-ghc, but for entire projects +" +" Note: Ideally, this would *only* typecheck. Right now, it also does codegen. +" See . + +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_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 new file mode 100644 index 00000000..0367dc24 --- /dev/null +++ b/ale_linters/haskell/stack_ghc.vim @@ -0,0 +1,10 @@ +" Author: w0rp +" Description: ghc for Haskell files, using Stack + +call ale#linter#Define('haskell', { +\ 'name': 'stack-ghc', +\ 'output_stream': 'stderr', +\ 'executable': 'stack', +\ 'command': 'stack ghc -- -fno-code -v0 %t', +\ 'callback': 'ale#handlers#haskell#HandleGHCFormat', +\}) -- cgit v1.2.3