Add sub_type to Elvis output (#3976)

Elvis is Erlang style reviewer, thus all loclist objects should have
sub_type set to style.
This commit is contained in:
Dmitri Vereshchagin 2021-11-12 10:50:56 +03:00 committed by GitHub
parent ff26ed7231
commit 76c2293e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,7 @@ function! ale_linters#erlang#elvis#Handle(buffer, lines) abort
\ 'lnum': str2nr(l:match[1]), \ 'lnum': str2nr(l:match[1]),
\ 'text': s:AbbreviateMessage(l:match[2]), \ 'text': s:AbbreviateMessage(l:match[2]),
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\}) \})
endfor endfor

View File

@ -11,11 +11,13 @@ Execute(Warning messages should be handled):
\ 'lnum': 11, \ 'lnum': 11,
\ 'text': "Replace the 'if' expression on line 11 with a 'case' expression or function clauses.", \ 'text': "Replace the 'if' expression on line 11 with a 'case' expression or function clauses.",
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\ }, \ },
\ { \ {
\ 'lnum': 20, \ 'lnum': 20,
\ 'text': 'Remove the debug call to io:format/1 on line 20.', \ 'text': 'Remove the debug call to io:format/1 on line 20.',
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\ }, \ },
\ ], \ ],
\ ale_linters#erlang#elvis#Handle(bufnr(''), [ \ ale_linters#erlang#elvis#Handle(bufnr(''), [
@ -30,6 +32,7 @@ Execute(Line length message shouldn't contain the line itself):
\ 'lnum': 24, \ 'lnum': 24,
\ 'text': 'Line 24 is too long.', \ 'text': 'Line 24 is too long.',
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\ }, \ },
\ ], \ ],
\ ale_linters#erlang#elvis#Handle(bufnr(''), [ \ ale_linters#erlang#elvis#Handle(bufnr(''), [