-
Notifications
You must be signed in to change notification settings - Fork 47
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
"Semantic" markup in SARIF messages #662
Comments
What does GCC output for that in SARIF now, without colorization? My first thought is that I'd place the color annotations in the {
"text": "format '{0}' expects argument of type '{1}', but argument {2} has type '{3}' [{4}]",
"placeholders": {
"0": { "role": "expected_type" },
"1": { "role": "expected_type" },
"3": { "role": "actual_type" },
"4": { "role": "option" }
}
} or as an array: {
"text": "format '{0}' expects argument of type '{1}', but argument {2} has type '{3}' [{4}]",
"placeholders": [
{ "role": "expected_type" },
{ "role": "expected_type" },
{},
{ "role": "actual_type" },
{ "role": "option" }
]
} This scheme would make the color information trivial to ignore for SARIF consumers that don't care about it. However, this does not seem easy to apply to |
From https://godbolt.org/z/9ja73xv19:
|
There doesn't seem to be a way to add "semantic" markup to messages in SARIF logs.
For example, in GCC 15 I've added colorization to some diagnostics to highlight expected type vs actual type; see:
https://godbolt.org/z/zqWGe5jKh
where note how
%i
in the message line and quoted source and theint
in the message line and the source annotation all appear in green (they're marked up internally asexpected_type
)const char *
in the message line and in the source annotation and themsg
in the quoted source all appear in dark blue (they're marked up internally asactual_type
)I'd like to capture this markup in the generated SARIF output, but we only support a subset of Markdown, and, in particular, HTML is forbidden.
The text was updated successfully, but these errors were encountered: