mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-21 17:18:38 +08:00
Improve formatting of ghc and hlint haskell linters
For ghc, it seemed that the conditional
```
if l:corrected_lines[-1] =~# ': error:$'
let l:line = substitute(l:line, '\v^\s+', ' ', '')
endif
```
was never being reached. It's actually better to unconditionally
collapse whitespace anyway and so I simply removed the conditional
check.
For hlint I added more information about the error. This changes the
reported error from `Error:` to something like:
` Error: Avoid lambda. Found: \ x -> foo x Why not: foo`
This commit is contained in:
@@ -29,9 +29,7 @@ function! ale_linters#haskell#ghc#Handle(buffer, lines)
|
||||
call add(l:corrected_lines, l:line)
|
||||
else
|
||||
if len(l:corrected_lines) > 0
|
||||
if l:corrected_lines[-1] =~# ': error:$'
|
||||
let l:line = substitute(l:line, '\v^\s+', ' ', '')
|
||||
endif
|
||||
let l:line = substitute(l:line, '\v\s+', ' ', '')
|
||||
let l:corrected_lines[-1] .= l:line
|
||||
endif
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user