diff options
author | w0rp <devw0rp@gmail.com> | 2017-07-13 22:47:43 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-07-13 22:47:43 +0100 |
commit | b50ae96413ef34c1ab631507d6763e7667fe8c85 (patch) | |
tree | c4159a4570b36972611cfa4fbce93398f0bd4612 /ale_linters/ruby | |
parent | f7f6f6541dcc7f05d9c31e116e70cb5067c65afa (diff) | |
download | ale-b50ae96413ef34c1ab631507d6763e7667fe8c85.zip |
#769 Ignore stderr output and output without JSON we can read for rubocop
Diffstat (limited to 'ale_linters/ruby')
-rw-r--r-- | ale_linters/ruby/rubocop.vim | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/ale_linters/ruby/rubocop.vim b/ale_linters/ruby/rubocop.vim index a539b1ae..eb5b61a3 100644 --- a/ale_linters/ruby/rubocop.vim +++ b/ale_linters/ruby/rubocop.vim @@ -14,22 +14,16 @@ function! ale_linters#ruby#rubocop#GetCommand(buffer) abort endfunction function! ale_linters#ruby#rubocop#Handle(buffer, lines) abort - if empty(a:lines) - return [] - endif - try let l:errors = json_decode(a:lines[0]) catch - return [{ - \ 'lnum': 1, - \ 'text': 'rubocop configuration error (type :ALEDetail for more information)', - \ 'detail': join(a:lines, "\n"), - \}] + return [] endtry - if l:errors['summary']['offense_count'] == 0 || empty(l:errors['files']) - return [] + if !has_key(l:errors, 'summary') + \|| l:errors['summary']['offense_count'] == 0 + \|| empty(l:errors['files']) + return [] endif let l:output = [] @@ -63,5 +57,4 @@ call ale#linter#Define('ruby', { \ 'executable_callback': 'ale#handlers#rubocop#GetExecutable', \ 'command_callback': 'ale_linters#ruby#rubocop#GetCommand', \ 'callback': 'ale_linters#ruby#rubocop#Handle', -\ 'output_stream': 'both', \}) |