mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 21:24:33 +08:00
Support older checkstyle versions
The output format used by older checkstyle versions differs from the one of new versions. This commit adds a second parsing iteration on the output lines with a suitable pattern to support both versions in parallel. Due to the differences in the order of matching groups this is hard to achieve in a single pass through the output lines. An appropriate test case is added.
This commit is contained in:
@@ -26,3 +26,16 @@ Execute(The checkstyle handler should parse lines correctly):
|
||||
\ '[WARN] whatever:101: ''method def rcurly'' has incorrect indentation level 4, expected level should be 2. [Indentation]',
|
||||
\ '[WARN] whatever:63:3: Missing a Javadoc comment. [JavadocMethod]',
|
||||
\ ])
|
||||
|
||||
Execute(The checkstyle handler should parse lines from older checkstyle versions correctly):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 289,
|
||||
\ 'text': '''method def modifier'' have incorrect indentation level 4, expected level should be 2.',
|
||||
\ 'type': 'W',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#java#checkstyle#Handle(666, [
|
||||
\ '/home/languitar/src/rsb-java/rsb-java/src/main/java/rsb/Listener.java:289: warning: ''method def modifier'' have incorrect indentation level 4, expected level should be 2.',
|
||||
\ ])
|
||||
|
||||
Reference in New Issue
Block a user