mirror of
https://github.com/actions/setup-java.git
synced 2025-05-23 02:51:46 +00:00
This commit adds a problem matcher for Checkstyle to allow automatic GitHub annotations. When run through Gradle, an example line is: ``` [ant:checkstyle] [ERROR] /root/Bound.java:7:2: 'import' has incorrect indentation level 1, expected level should be 0. [Indentation] ``` Alternatively, when run standalone, an example output is: ``` [WARN] /root/test.java:2:1: The name of the outer type and the file do not match. [OuterTypeFilename] ``` The regular expression matches both cases. In the latter example, `WARN`, rather than `WARNING` is output. This is resolved by using a default severity of `warning`, which will be overridden in the case that the severity is `ERROR`.
20 lines
494 B
JSON
20 lines
494 B
JSON
{
|
|
"problemMatcher": [
|
|
{
|
|
"owner": "checkstyle",
|
|
"severity": "warning",
|
|
"pattern": [
|
|
{
|
|
"regexp": "^.*\\[(ERROR|WARN)\\]\\s+(.*):(\\d+):(\\d+):\\s+(.*)\\s+\\[(.*)\\]$",
|
|
"severity": 1,
|
|
"file": 2,
|
|
"line": 3,
|
|
"column": 4,
|
|
"message": 5,
|
|
"code": 6
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|