fix: don't omit zero ruleIndex#97
Merged
owenrumney merged 1 commit intoowenrumney:mainfrom Mar 27, 2025
Merged
Conversation
owenrumney
approved these changes
Mar 27, 2025
Owner
owenrumney
left a comment
There was a problem hiding this comment.
Looks good thanks, seems I can't push to your branch so I'll follow this with the wider fix to all int/float64 where there is a non-pointer val
Thanks again
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @owenrumney,
I found another issue in v3 and a potential bug in the code generator you mentioned in #93.
The
ruleIndexproperty of aresultis currently omitted when empty, even though0is a valid value and should be included in the SARIF JSON. A quick fix is to remove theomitemptytag from theResultstruct field, but in v2 this was addressed by changing the type fromint(uint) to*int(*uint), ensuring the field is omitted only when truly unset.Some SARIF integer fields also default to
-1and are omitted when0, similar toruleIndex. I haven't fully investigated whether the same fix should be applied to them, but I'm fairly sure aboutresult.rank, as it can also be0.Let me know what you think!