Skip to content

Instantly share code, notes, and snippets.

@packrat386
Created March 23, 2022 18:57
Show Gist options
  • Save packrat386/fe58973f1be437fd7569454e50cf3663 to your computer and use it in GitHub Desktop.
Save packrat386/fe58973f1be437fd7569454e50cf3663 to your computer and use it in GitHub Desktop.
jq program to filter out specs from `snyk code test`
.runs[0].results |
map(
select(
.locations[0].physicalLocation.artifactLocation.uri |
contains("spec") |
not
)
) |
map(
.locations[0].physicalLocation.artifactLocation.uri as $filename |
.locations[0].physicalLocation.region.startLine as $line |
.ruleId as $ruleid |
.level as $level |
.message.text as $message |
{ ruleid: $ruleid, level: $level, message: $message, filename: $filename, line: $line }
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment