Skip to content

Commit 907aa03

Browse files
Code-quality batch 1: document jq-avoidance in capture_scorecard.sh
Add a one-line WHY comment above the python3 JSON-escape call so the next reader doesn't "helpfully" rewrite it to `jq` and break the zero-extra-dependency contract for the template-pack toolchain.
1 parent 98b6b8b commit 907aa03

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/capture_scorecard.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ CAMPAIGN_VERSION="$($CAMPAIGN --version 2>/dev/null | head -1 || echo unknown)"
8383
printf ' "counterexamples": '
8484
if [ "$VIOLATED" -eq 1 ]; then
8585
printf '[{ "invariant_name": "%s", "raw": ' "$INVARIANT"
86-
# JSON-escape the counterexample text.
86+
# WHY: JSON-escape via python3's stdlib instead of jq — keeps the
87+
# template-pack toolchain to sh + python3 (already required by Echidna /
88+
# Medusa setups) so users don't need to install jq just to render a
89+
# scorecard. Do not "helpfully" rewrite this to `jq` — it breaks the
90+
# zero-extra-dependency contract.
8791
python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))' < "$COUNTEREX_FILE"
8892
printf ' }]\n'
8993
else

0 commit comments

Comments
 (0)