Skip to content

Commit

Permalink
Add various Problem Matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed May 30, 2021
1 parent d5c29b4 commit 7c5129f
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/matchers/check-json.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"__comment": "Credits to: https://github.com/home-assistant/core/blob/d32c364d7f9e138e0dd9363b34b3cb39f4afcd06/.github/workflows/matchers/check-json.json",
"problemMatcher": [
{
"owner": "check-json",
"pattern": [
{
"regexp": "^(.+):\\s(Failed to json decode\\s.+\\sline\\s(\\d+)\\scolumn\\s(\\d+).+)$",
"file": 1,
"message": 2,
"line": 3,
"column": 4
}
]
}
]
}
16 changes: 16 additions & 0 deletions .github/workflows/matchers/check-toml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "check-toml",
"pattern": [
{
"regexp": "^(.+\\.toml):\\s(.+line\\s(\\d+)\\scolumn\\s(\\d+).+)$",
"file": 1,
"message": 2,
"line": 3,
"column": 4
}
]
}
]
}
19 changes: 19 additions & 0 deletions .github/workflows/matchers/check-yaml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"problemMatcher": [
{
"owner": "check-yaml",
"pattern": [
{
"regexp": "^(.+)$",
"message": 1
},
{
"regexp": "^ in \"(.+\\.ya?ml)\", line (\\d+), column (\\d+)$",
"file": 1,
"line": 2,
"column": 3
}
]
}
]
}
32 changes: 32 additions & 0 deletions .github/workflows/matchers/flake8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"__comment": "Credits to: https://github.com/home-assistant/core/blob/d32c364d7f9e138e0dd9363b34b3cb39f4afcd06/.github/workflows/matchers/flake8.json",
"problemMatcher": [
{
"owner": "flake8-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(([EF]\\d{3})\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
},
{
"owner": "flake8-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(([CDNW]\\d{3})\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}
8 changes: 8 additions & 0 deletions .github/workflows/run_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

# Register problem matchers
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/check-json.json"
echo "::add-matcher::.github/workflows/matchers/check-toml.json"
echo "::add-matcher::.github/workflows/matchers/check-yaml.json"
echo "::add-matcher::.github/workflows/matchers/flake8.json"
# Run pre-commit
- name: Run pre-commit
run: |
Expand Down

0 comments on commit 7c5129f

Please sign in to comment.