summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhong Nguyen <nhphong1406@gmail.com>2021-12-13 20:35:26 +0700
committerGitHub <noreply@github.com>2021-12-13 22:35:26 +0900
commite4ec2e4dc74fc24d57fd74770d2aa277425dde7c (patch)
tree7a69ad29e05718deea3d159bd4b58fa599ef4ced
parent091592bfb09e7e994bd860fa3776e8cf4346bf5a (diff)
downloadale-e4ec2e4dc74fc24d57fd74770d2aa277425dde7c.zip
Fix crash for Reek 6.0.4 (#4010)
When `let g:ale_ruby_reek_show_wiki_link = 1`, Reek linter is crashed because `wiki_link` attribute does not exist in result. It seems that `wiki_link` is now replaced with `documentation_link` in recent version of Reek
-rw-r--r--ale_linters/ruby/reek.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/ale_linters/ruby/reek.vim b/ale_linters/ruby/reek.vim
index 226b452e..b6fa9d76 100644
--- a/ale_linters/ruby/reek.vim
+++ b/ale_linters/ruby/reek.vim
@@ -19,6 +19,10 @@ function! ale_linters#ruby#reek#GetCommand(buffer, version) abort
\ . l:display_name_args
endfunction
+function! s:GetDocumentationLink(error) abort
+ return get(a:error, 'documentation_link', get(a:error, 'wiki_link', ''))
+endfunction
+
function! s:BuildText(buffer, error) abort
let l:parts = []
@@ -29,7 +33,7 @@ function! s:BuildText(buffer, error) abort
call add(l:parts, a:error.message)
if ale#Var(a:buffer, 'ruby_reek_show_wiki_link')
- call add(l:parts, '[' . a:error.wiki_link . ']')
+ call add(l:parts, '[' . s:GetDocumentationLink(a:error) . ']')
endif
return join(l:parts, ' ')