Compare commits

..

No commits in common. "c5c5364205a913cb71eeae8be47a8896f90e071b" and "635cc5748c0ce624968d00052ccab9bcf70f4d69" have entirely different histories.

4 changed files with 3 additions and 74 deletions

View File

@ -1 +0,0 @@
setlocal expandtab

View File

@ -85,14 +85,10 @@ let g:ghcmod_hlint_options = ['--ignore=Eta reduce $']
" ALE
let g:ale_enabled = 1
let g:ale_linters = {'haskell':['ghc-mod', 'hdevtools'], 'c':['clang']}
" let g:ale_linters = {'haskell':['ghc-mod', 'hdevtools', 'argon'], 'c':['clang']}
" let g:ale_fixers = {
" \ 'go': ['gofmt', 'goimports'],
" \}
let g:ale_haskell_hdevtools_options = "-g '-Wall' -g '-Wno-orphans'"
let g:ale_haskell_argon_error_level = 14
let g:ale_haskell_argon_warn_level = 10
let g:ale_haskell_argon_info_level = 6
" completion
"

View File

@ -1,64 +0,0 @@
" Author: Julian Ospald <hasufell@hasufell.de>
" Description: argon for Haskell files
call ale#Set('haskell_argon_executable', 'argon')
call ale#Set('haskell_argon_options', '')
call ale#Set('haskell_argon_error_level', 12)
call ale#Set('haskell_argon_warn_level', 8)
call ale#Set('haskell_argon_info_level', 4)
function! ale_linters#haskell#argon#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'haskell_argon_executable')
endfunction
function! ale_linters#haskell#argon#GetCommand(buffer) abort
return ale#Escape(ale_linters#haskell#argon#GetExecutable(a:buffer))
\ . ' '
\ . ale#Var(a:buffer, 'haskell_argon_options')
\ . ' -m ' . ale#Var(a:buffer, 'haskell_argon_info_level')
\ . ' -j'
\ . ' %t'
endfunction
function! ale_linters#haskell#argon#Handle(buffer, lines) abort
let l:output = []
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
for l:block in l:error.blocks
let l:complexity = l:block.complexity
if l:complexity >= ale#Var(a:buffer, 'haskell_argon_error_level')
let l:type = 'E'
let l:max_c = ale#Var(a:buffer, 'haskell_argon_error_level')
elseif l:complexity >= ale#Var(a:buffer, 'haskell_argon_warn_level')
let l:type = 'W'
let l:max_c = ale#Var(a:buffer, 'haskell_argon_warn_level')
else
let l:type = 'I'
let l:max_c = ale#Var(a:buffer, 'haskell_argon_info_level')
endif
call add(l:output, {
\ 'filename': l:error.path,
\ 'lnum': str2nr(l:block.lineno),
\ 'col': str2nr(l:block.col),
\ 'text': l:block.name . ': cyclomatic complexity of ' . l:complexity,
\ 'type': l:type,
\})
endfor
endfor
return l:output
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'argon',
\ 'executable_callback': 'ale_linters#haskell#argon#GetExecutable',
\ 'command_callback': 'ale_linters#haskell#argon#GetCommand',
\ 'callback': 'ale_linters#haskell#argon#Handle',
\})

8
vimrc
View File

@ -80,9 +80,7 @@ Plug 'autozimu/LanguageClient-neovim', {
Plug 'junegunn/fzf', { 'for': 'haskell' }
" linting/compilation
Plug 'w0rp/ale', {
\ 'do': 'bash -c \"cp -R ~/.vim/ale_linters .\"',
\ }
Plug 'w0rp/ale'
" haskell
" if has("nvim")
@ -92,7 +90,7 @@ Plug 'eagletmt/ghcmod-vim', { 'for': 'haskell' }
" completion based on ghc-mod, not LSP
" Plug 'eagletmt/neco-ghc', { 'for': 'haskell' }
Plug 'lukerandall/haskellmode-vim', { 'for': 'haskell' }
Plug 'neovimhaskell/haskell-vim', { 'for': ['haskell', 'cabal'] }
Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' }
Plug 'ucsd-progsys/liquid-types.vim', { 'for': 'haskell' }
Plug 'bitc/lushtags', {
\ 'do': 'bash -c \"cabal clean && cabal sandbox delete && cabal sandbox init && cabal install && cp .cabal-sandbox/bin/lushtags ~/.cabal/bin/lushtags\"',
@ -294,7 +292,7 @@ vnoremap x "_x
nnoremap x "_x
" Syntax
syntax on
syntax enable
" pane navigation
" Use ctrl-[hjkl] to select the active split!