Skip to content

Instantly share code, notes, and snippets.

@joe-warren
Created October 28, 2021 13:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joe-warren/f39b6605a7f2678b0048fa08a3c8b674 to your computer and use it in GitHub Desktop.
Save joe-warren/f39b6605a7f2678b0048fa08a3c8b674 to your computer and use it in GitHub Desktop.
{
"problemMatcher": [
{
"owner": "hlint",
"severity": "warning",
"pattern": [
{
"regexp": "^([^:]*\\/)([^:/]*):(\\d+)(-\\d+)?:(\\d+)(-\\d+)?: (Warning|Error): (.*)$",
"fromPath": 1,
"file": 2,
"line": 3,
"column": 5,
"message": 8
}
]
},
{
"owner": "hlint-multiline",
"severity": "warning",
"pattern": [
{
"regexp": "^([^:]*\\/)([^:/]*):\\((\\d+),(\\d+)\\)-\\(\\d+,\\d+\\): (Warning|Error): (.*)$",
"fromPath": 1,
"file": 2,
"line": 3,
"column": 4,
"message": 6
}
]
}
]
}
@joe-warren
Copy link
Author

GitHub Actions Problem Matcher for HLint (creates PR annotations based on log output).

You can register this (before running hlint), by running

echo "::add-matcher::hlint-matcher.json"  

Matches the first line of each warning.

As written, this only matches the more severe "Warning" level suggestions, and not "Suggestions".
You can change this by replacing (Warning|Error) with (Suggestion|Warning|Error) in the two regular expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment