-
Notifications
You must be signed in to change notification settings - Fork 16
json-writer: print level
key in SARIF output
#81
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on it! Some minor issues inline...
... so that users can easily filter results according to their severity. Fixes: csutils#80 Co-authored-by: Kamil Dudka <[email protected]> Co-authored-by: Lukáš Zaoral <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -214,6 +214,24 @@ static void sarifEncodeMsg(PTree *pDst, const std::string& text) | |||
pDst->put_child("message", msg); | |||
} | |||
|
|||
static void sarifEncodeLevel(PTree *result, const std::string &event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: fix bracket formatting inconsistency in some future commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might consider using this one-liner in CI to catch this:
grep '^static .*) *{$' src/*
There is one more inconsistency in abstarct-parser.cc
:
src/abstract-parser.cc:static inline std::unique_ptr<T> make_unique(InStream &input) {
src/json-writer.cc:static void sarifEncodeLevel(PTree *result, const std::string &event) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a custom .clang-format
config to enforce code style is would be a better solution. Tracked in #86.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would mean more work than the proposed one-liner. But if we have a volunteer to work on this, why not :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not that hard, I've already done it few times. Additionally, such config file can be then used in all of our projects.
... so that users can easily filter results according to their severity.
Fixes: #80