From 025f3407d68da712253e24a11b9acd0c7ae84ca8 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 9 Jul 2017 15:50:12 +0100 Subject: [PATCH] Simplify ale_linters#ruby#rubocop#GetType --- ale_linters/ruby/rubocop.vim | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ale_linters/ruby/rubocop.vim b/ale_linters/ruby/rubocop.vim index 1756f45..30aadd0 100644 --- a/ale_linters/ruby/rubocop.vim +++ b/ale_linters/ruby/rubocop.vim @@ -37,20 +37,13 @@ function! ale_linters#ruby#rubocop#Handle(buffer, lines) abort endfunction function! ale_linters#ruby#rubocop#GetType(severity) abort - if a:severity ==? 'refactor' + if a:severity ==? 'convention' + \|| a:severity ==? 'warning' + \|| a:severity ==? 'refactor' return 'W' - elseif a:severity ==? 'convention' - return 'W' - elseif a:severity ==? 'warning' - return 'W' - elseif a:severity ==? 'error' - return 'E' - elseif a:severity ==? 'fatal' - return 'E' - else - echo 'Rubocop offense type unrecognized by ALE: ' + a:severity - return '' endif + + return 'E' endfunction call ale#linter#Define('ruby', {