-
Notifications
You must be signed in to change notification settings - Fork 602
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
Emit fixes local to the result, not as an aggregate #5425
Conversation
@ajbt200128 trying with https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/schemas/sarif-schema-2.1.0.json, which is the latest version. |
Great, if it works, make sure to regenerate the tests so the output contains the new schema url :) |
@ajbt200128 had to join |
Good catch, can you escape the newlines though instead of removing them? That'd be in accordant w/ the json specs. After that we should be good |
@ajbt200128 I didn't remove them. |
@kristof-mattei my bad, I misread, but either way, they should be joined with escaped new lines, as per the json spec |
@ajbt200128 they are escaped in the rendered output:
|
great! |
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.
Looks good!
@ajbt200128 can you push this on the finish line? |
It would be nice if this could be merged soon, it's quite annoying to have the CI jobs fail on every commit because of this. 😄 |
Fix for #5421
Testing https://github.com/returntocorp/semgrep/blob/5dbf6dd47ab4fda6e9dc8dec42b90fce24d1fd82/semgrep/tests/e2e/snapshots/test_output/test_sarif_output_with_autofix/results.sarif against https://github.com/oasis-tcs/sarif-spec/blob/master/Documents/CommitteeSpecifications/2.1.0/sarif-schema-2.1.0.json validates 100%.
I don't want to use that url though as the $schema in the files we generate, as that is not the spec.
PR checklist:
didn't update as the prefix 'fixes' is still under 'unreleased': https://github.com/returntocorp/semgrep/blob/develop/CHANGELOG.md#added