diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-02 13:55:24 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-08-02 13:55:54 +0900 |
commit | bc1cf285c264a463f1a5cb4e8d31f8dfea7cdfbc (patch) | |
tree | 5187d794dc0cc2ac008025557b0a05be679125fe | |
parent | 35913d9ce7c9679c1242ffdf14bfa1126c999e7e (diff) | |
download | ale-bc1cf285c264a463f1a5cb4e8d31f8dfea7cdfbc.zip |
Rubocop: Show cop name
-rw-r--r-- | ale_linters/ruby/rubocop.vim | 2 | ||||
-rw-r--r-- | test/handler/test_rubocop_handler.vader | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ale_linters/ruby/rubocop.vim b/ale_linters/ruby/rubocop.vim index eb5b61a3..3d7b64d1 100644 --- a/ale_linters/ruby/rubocop.vim +++ b/ale_linters/ruby/rubocop.vim @@ -34,7 +34,7 @@ function! ale_linters#ruby#rubocop#Handle(buffer, lines) abort \ 'lnum': l:error['location']['line'] + 0, \ 'col': l:start_col, \ 'end_col': l:start_col + l:error['location']['length'] - 1, - \ 'text': l:error['message'], + \ 'text': printf('%s [%s]', l:error['message'], l:error['cop_name']), \ 'type': ale_linters#ruby#rubocop#GetType(l:error['severity']), \}) endfor diff --git a/test/handler/test_rubocop_handler.vader b/test/handler/test_rubocop_handler.vader index fffee7bb..4d3bbe29 100644 --- a/test/handler/test_rubocop_handler.vader +++ b/test/handler/test_rubocop_handler.vader @@ -12,28 +12,28 @@ Execute(The rubocop handler should parse lines correctly): \ 'lnum': 83, \ 'col': 29, \ 'end_col': 35, - \ 'text': 'Prefer single-quoted strings...', + \ 'text': 'Prefer single-quoted strings... [Style/SomeCop]', \ 'type': 'W', \ }, \ { \ 'lnum': 12, \ 'col': 2, \ 'end_col': 2, - \ 'text': 'Some error', + \ 'text': 'Some error [Style/SomeOtherCop]', \ 'type': 'E', \ }, \ { \ 'lnum': 10, \ 'col': 5, \ 'end_col': 12, - \ 'text': 'Regular warning', + \ 'text': 'Regular warning [Style/WarningCop]', \ 'type': 'W', \ }, \ { \ 'lnum': 11, \ 'col': 1, \ 'end_col': 1, - \ 'text': 'Another error', + \ 'text': 'Another error [Style/SpaceBeforeBlockBraces]', \ 'type': 'E', \ }, \ ], |