Skip to content

Commit 6669cc8

Browse files
committed
[PLUTO-1411] Add script
1 parent c903bfc commit 6669cc8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

run-tool-tests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ cd "$TOOL_DIR"
3535
# Handle both path formats: with and without extra codacy-cli-v2
3636
sed -i 's|file:///home/runner/work/codacy-cli-v2/|file:///|g' actual.sarif
3737

38-
# Sort rules by ID in both files
39-
jq '.runs[0].tool.driver.rules |= sort_by(.id)' expected.sarif > expected.sorted.json
40-
jq '.runs[0].tool.driver.rules |= sort_by(.id)' actual.sarif > actual.sorted.json
38+
# Sort all fields in both files, handling null rules array
39+
jq --sort-keys 'if .runs[0].tool.driver.rules == null then . else .runs[0].tool.driver.rules |= sort_by(.id) end' expected.sarif > expected.sorted.json
40+
jq --sort-keys 'if .runs[0].tool.driver.rules == null then . else .runs[0].tool.driver.rules |= sort_by(.id) end' actual.sarif > actual.sorted.json
4141

4242
# Run diff and capture its exit code
4343
if ! diff expected.sorted.json actual.sorted.json; then

0 commit comments

Comments
 (0)