Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a clang problem matcher #43222

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/CBA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
cmake -DCMAKE_BUILD_TYPE=RELEASE ..
cmake --build . -- -j3
echo "::add-path::$PWD"
- name: Add problem matcher
run: echo "::add-matcher::build-scripts/problem-matchers/clang.json"
- name: make
run: |
ClangBuildAnalyzer --start .
Expand Down
18 changes: 18 additions & 0 deletions build-scripts/problem-matchers/clang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "cata-clang",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(error|warning):\\s(.+)\\s\\[(.+)\\]$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
"code": 6
}
]
}
]
}
Comment on lines +1 to +18

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might find this problem matcher just works:
https://github.com/marketplace/actions/gcc-problem-matcher

Otherwise you might want to publish the problem matcher JSON as an action on its own (like the GCC one) so others can benefit too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm mildly in favour of using the existing action, let's go that way unless you have an objection jbtw.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll close this and open another PR.

3 changes: 3 additions & 0 deletions build-scripts/requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ function just_json
return 0
}

# Enable GitHub actions problem matcher
echo "::add-matcher::build-scripts/problem-matchers/clang.json"

if which travis_retry &>/dev/null
then
travis_retry=travis_retry
Expand Down