Change checkstyle's output sub_type to style (#3780)

This commit is contained in:
Frederick Zhang 2021-07-04 22:31:00 +10:00 committed by GitHub
parent 9efa96eb94
commit afcbd1620e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, { call add(l:output, {
\ 'type': l:match[1] is? 'WARN' ? 'W' : 'E', \ 'type': l:match[1] is? 'WARN' ? 'W' : 'E',
\ 'sub_type': 'style',
\ 'lnum': l:match[2] + 0, \ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0, \ 'col': l:match[3] + 0,
\ 'text': l:match[4], \ 'text': l:match[4],
@ -31,6 +32,7 @@ function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, { call add(l:output, {
\ 'type': l:match[3] is? 'warning' ? 'W' : 'E', \ 'type': l:match[3] is? 'warning' ? 'W' : 'E',
\ 'sub_type': 'style',
\ 'lnum': l:match[2] + 0, \ 'lnum': l:match[2] + 0,
\ 'text': l:match[4], \ 'text': l:match[4],
\}) \})

View File

@ -13,6 +13,7 @@ Execute(The checkstyle handler should parse lines correctly):
\ 'text': '''method def rcurly'' has incorrect indentation level 4, expected level should be 2.', \ 'text': '''method def rcurly'' has incorrect indentation level 4, expected level should be 2.',
\ 'code': 'Indentation', \ 'code': 'Indentation',
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\ }, \ },
\ { \ {
\ 'lnum': 63, \ 'lnum': 63,
@ -20,6 +21,7 @@ Execute(The checkstyle handler should parse lines correctly):
\ 'text': 'Missing a Javadoc comment.', \ 'text': 'Missing a Javadoc comment.',
\ 'code': 'JavadocMethod', \ 'code': 'JavadocMethod',
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\ }, \ },
\ { \ {
\ 'lnum': 11, \ 'lnum': 11,
@ -27,6 +29,7 @@ Execute(The checkstyle handler should parse lines correctly):
\ 'text': 'WhitespaceAround: ''if'' is not followed by whitespace.', \ 'text': 'WhitespaceAround: ''if'' is not followed by whitespace.',
\ 'code': 'WhitespaceAround', \ 'code': 'WhitespaceAround',
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\ }, \ },
\ ], \ ],
\ ale_linters#java#checkstyle#Handle(666, [ \ ale_linters#java#checkstyle#Handle(666, [
@ -42,6 +45,7 @@ Execute(The checkstyle handler should parse lines from older checkstyle versions
\ 'lnum': 289, \ 'lnum': 289,
\ 'text': '''method def modifier'' have incorrect indentation level 4, expected level should be 2.', \ 'text': '''method def modifier'' have incorrect indentation level 4, expected level should be 2.',
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\ }, \ },
\ ], \ ],
\ ale_linters#java#checkstyle#Handle(666, [ \ ale_linters#java#checkstyle#Handle(666, [