From b50a7318fbf8836b820df9d10e0fc6ffba6bcd1e Mon Sep 17 00:00:00 2001 From: Jake Zimmerman Date: Sun, 9 Jul 2017 16:39:33 -0500 Subject: Add new Haskell linter (#742) * Add stack-build linter for Haskell The stack-build linter works better than the other two linters when you're working with an entire Haskell project. It builds the project entirely and reports any errors. The other two Haskell GHC linters only work on single files, which can result in spurious errors (for example, not being able to find imports). * Document all available Haskell linters * Split GHC checkers into separate files --- ale_linters/haskell/ghc.vim | 8 -------- ale_linters/haskell/stack-build.vim | 14 ++++++++++++++ ale_linters/haskell/stack-ghc.vim | 10 ++++++++++ 3 files changed, 24 insertions(+), 8 deletions(-) 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/ghc.vim b/ale_linters/haskell/ghc.vim index ee6370b5..fdf22f9f 100644 --- a/ale_linters/haskell/ghc.vim +++ b/ale_linters/haskell/ghc.vim @@ -8,11 +8,3 @@ call ale#linter#Define('haskell', { \ 'command': 'ghc -fno-code -v0 %t', \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) - -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..1c2a06f6 --- /dev/null +++ b/ale_linters/haskell/stack-build.vim @@ -0,0 +1,14 @@ +" 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 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