Merge pull request #820 from junegunn/rubocop-cop-name
Rubocop: Show cop name
This commit is contained in:
		
						commit
						db531171ac
					
				@ -34,7 +34,7 @@ function! ale_linters#ruby#rubocop#Handle(buffer, lines) abort
 | 
				
			|||||||
        \   'lnum': l:error['location']['line'] + 0,
 | 
					        \   'lnum': l:error['location']['line'] + 0,
 | 
				
			||||||
        \   'col': l:start_col,
 | 
					        \   'col': l:start_col,
 | 
				
			||||||
        \   'end_col': l:start_col + l:error['location']['length'] - 1,
 | 
					        \   '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']),
 | 
					        \   'type': ale_linters#ruby#rubocop#GetType(l:error['severity']),
 | 
				
			||||||
        \})
 | 
					        \})
 | 
				
			||||||
    endfor
 | 
					    endfor
 | 
				
			||||||
 | 
				
			|||||||
@ -12,28 +12,28 @@ Execute(The rubocop handler should parse lines correctly):
 | 
				
			|||||||
  \     'lnum': 83,
 | 
					  \     'lnum': 83,
 | 
				
			||||||
  \     'col': 29,
 | 
					  \     'col': 29,
 | 
				
			||||||
  \     'end_col': 35,
 | 
					  \     'end_col': 35,
 | 
				
			||||||
  \     'text': 'Prefer single-quoted strings...',
 | 
					  \     'text': 'Prefer single-quoted strings... [Style/SomeCop]',
 | 
				
			||||||
  \     'type': 'W',
 | 
					  \     'type': 'W',
 | 
				
			||||||
  \   },
 | 
					  \   },
 | 
				
			||||||
  \   {
 | 
					  \   {
 | 
				
			||||||
  \     'lnum': 12,
 | 
					  \     'lnum': 12,
 | 
				
			||||||
  \     'col': 2,
 | 
					  \     'col': 2,
 | 
				
			||||||
  \     'end_col': 2,
 | 
					  \     'end_col': 2,
 | 
				
			||||||
  \     'text': 'Some error',
 | 
					  \     'text': 'Some error [Style/SomeOtherCop]',
 | 
				
			||||||
  \     'type': 'E',
 | 
					  \     'type': 'E',
 | 
				
			||||||
  \   },
 | 
					  \   },
 | 
				
			||||||
  \   {
 | 
					  \   {
 | 
				
			||||||
  \     'lnum': 10,
 | 
					  \     'lnum': 10,
 | 
				
			||||||
  \     'col': 5,
 | 
					  \     'col': 5,
 | 
				
			||||||
  \     'end_col': 12,
 | 
					  \     'end_col': 12,
 | 
				
			||||||
  \     'text': 'Regular warning',
 | 
					  \     'text': 'Regular warning [Style/WarningCop]',
 | 
				
			||||||
  \     'type': 'W',
 | 
					  \     'type': 'W',
 | 
				
			||||||
  \   },
 | 
					  \   },
 | 
				
			||||||
  \   {
 | 
					  \   {
 | 
				
			||||||
  \     'lnum': 11,
 | 
					  \     'lnum': 11,
 | 
				
			||||||
  \     'col': 1,
 | 
					  \     'col': 1,
 | 
				
			||||||
  \     'end_col': 1,
 | 
					  \     'end_col': 1,
 | 
				
			||||||
  \     'text': 'Another error',
 | 
					  \     'text': 'Another error [Style/SpaceBeforeBlockBraces]',
 | 
				
			||||||
  \     'type': 'E',
 | 
					  \     'type': 'E',
 | 
				
			||||||
  \   },
 | 
					  \   },
 | 
				
			||||||
  \ ],
 | 
					  \ ],
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user