#!/bin/sh
# Wall-clock timing of each scan mode on the repo mounted at /work.
# cold = Skylos cache cleared first; warm = cache left from the previous run.
git config --global --add safe.directory '*'
clear_cache() { rm -rf /work/.skylos/cache ~/.cache/skylos 2>/dev/null; }
t() { label=$1; shift; s=$(date +%s.%N); "$@" >/tmp/out.txt 2>&1; rc=$?; e=$(date +%s.%N); printf '%-38s %6.1fs  exit=%s\n' "$label" "$(echo "$e - $s" | bc)" "$rc"; }
cd /work
clear_cache; t "skylos . (dead code only), cold"     skylos . --format json -o /tmp/dead.json
clear_cache; t "skylos . -a (everything), cold"      skylos . -a --format json -o /tmp/all.json
             t "skylos . -a (everything), warm"      skylos . -a --format json -o /tmp/all2.json
clear_cache; t "skylos verify . --no-security, cold" skylos verify . --no-security --format json -o /tmp/verify.json
             t "ruff check (default rules)"          ruff check --quiet .
