summaryrefslogtreecommitdiff
path: root/ale_linters/ruby/reek.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-19 00:54:09 +0000
committerw0rp <devw0rp@gmail.com>2017-11-19 00:54:09 +0000
commit7123f7236b5415c29f1b48c01d2528f71c457be2 (patch)
treec6126064962e41a74e5555139045f7ce692fd359 /ale_linters/ruby/reek.vim
parentc012563984f0470a7c637b3b55cebea28b7a50b0 (diff)
downloadale-7123f7236b5415c29f1b48c01d2528f71c457be2.zip
#852 - Capture error codes for reek
Diffstat (limited to 'ale_linters/ruby/reek.vim')
-rw-r--r--ale_linters/ruby/reek.vim11
1 files changed, 6 insertions, 5 deletions
diff --git a/ale_linters/ruby/reek.vim b/ale_linters/ruby/reek.vim
index 10bc9a84..a11b9cf8 100644
--- a/ale_linters/ruby/reek.vim
+++ b/ale_linters/ruby/reek.vim
@@ -13,6 +13,7 @@ function! ale_linters#ruby#reek#Handle(buffer, lines) abort
\ 'lnum': l:location,
\ 'type': 'W',
\ 'text': s:BuildText(a:buffer, l:error),
+ \ 'code': l:error.smell_type,
\})
endfor
endfor
@@ -21,19 +22,19 @@ function! ale_linters#ruby#reek#Handle(buffer, lines) abort
endfunction
function! s:BuildText(buffer, error) abort
- let l:text = a:error.smell_type . ':'
+ let l:parts = []
if ale#Var(a:buffer, 'ruby_reek_show_context')
- let l:text .= ' ' . a:error.context
+ call add(l:parts, a:error.context)
endif
- let l:text .= ' ' . a:error.message
+ call add(l:parts, a:error.message)
if ale#Var(a:buffer, 'ruby_reek_show_wiki_link')
- let l:text .= ' [' . a:error.wiki_link . ']'
+ call add(l:parts, '[' . a:error.wiki_link . ']')
endif
- return l:text
+ return join(l:parts, ' ')
endfunction
call ale#linter#Define('ruby', {