diff options
author | Horacio Sanson <horacio@allm.net> | 2019-05-28 17:48:27 +0900 |
---|---|---|
committer | Horacio Sanson <horacio@allm.net> | 2019-05-28 17:48:27 +0900 |
commit | 181bc69c8c0b113d8f5b8325f6faf1580d1fadd7 (patch) | |
tree | d15187649ea4cbe2bb4447e012e32a47cf52f661 /ale_linters/java | |
parent | bb08b81bf719d4c55669c583c65fbe4bbd795501 (diff) | |
download | ale-181bc69c8c0b113d8f5b8325f6faf1580d1fadd7.zip |
Fix java checkstyle handler.
The checkstyle handler is capable of parsing the new and old output
formats. Unfortunately there are some particular output messages that
matched both the new and old regular expressions:
[WARN] whatever:11:7: WhitespaceAround: ''if'' is not followed by whitespace. [WhitespaceAround]
This caused ALE to report extra errors since the message was being
matched twice, once as a warning and another (incorrect) old formatted
error.
This MR fixes this by stopping any parsing using the old format regexp
is any errors of the new format are correcly parsed. There is no reason
to expect checkstyle to output both styles in the same report.
Diffstat (limited to 'ale_linters/java')
-rw-r--r-- | ale_linters/java/checkstyle.vim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ale_linters/java/checkstyle.vim b/ale_linters/java/checkstyle.vim index 3159cd55..cc93ee8a 100644 --- a/ale_linters/java/checkstyle.vim +++ b/ale_linters/java/checkstyle.vim @@ -17,6 +17,10 @@ function! ale_linters#java#checkstyle#Handle(buffer, lines) abort \}) endfor + if !empty(l:output) + return l:output + endif + " old checkstyle versions let l:pattern = '\v(.+):(\d+): ([^:]+): (.+)$' |