summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorHong Minhee <hong.minhee@gmail.com>2016-10-06 22:46:51 +0900
committerHong Minhee <hong.minhee@gmail.com>2016-10-06 22:46:51 +0900
commit94842a257e170397913b41c91194487dcca42921 (patch)
treeff99020442ce164f54b7ef43a3826af83854d4d0 /ale_linters
parent596a374c6ec080fbd667e1686729ed9173a725cb (diff)
downloadale-94842a257e170397913b41c91194487dcca42921.zip
GHC Linter for Haskell Stack
https://haskellstack.org/
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/haskell/ghc.vim15
1 files changed, 14 insertions, 1 deletions
diff --git a/ale_linters/haskell/ghc.vim b/ale_linters/haskell/ghc.vim
index 71988a21..0e6c2cf1 100644
--- a/ale_linters/haskell/ghc.vim
+++ b/ale_linters/haskell/ghc.vim
@@ -22,11 +22,16 @@ function! ale_linters#haskell#ghc#Handle(buffer, lines)
for line in a:lines
if len(matchlist(line, pattern)) > 0
call add(corrected_lines, line)
- call add(corrected_lines, '')
+ if line !~ ': error:$'
+ call add(corrected_lines, '')
+ endif
elseif line == ''
call add(corrected_lines, line)
else
if len(corrected_lines) > 0
+ if corrected_lines[-1] =~ ': error:$'
+ let line = substitute(line, '\v^\s+', ' ', '')
+ endif
let corrected_lines[-1] .= line
endif
endif
@@ -60,3 +65,11 @@ call ALEAddLinter('haskell', {
\ 'command': g:ale#util#stdin_wrapper . ' .hs ghc -fno-code -v0',
\ 'callback': 'ale_linters#haskell#ghc#Handle',
\})
+
+call ALEAddLinter('haskell', {
+\ 'name': 'stack-ghc',
+\ 'output_stream': 'stderr',
+\ 'executable': 'stack',
+\ 'command': g:ale#util#stdin_wrapper . ' .hs stack ghc -- -fno-code -v0',
+\ 'callback': 'ale_linters#haskell#ghc#Handle',
+\})