Files
johannesandClaude Sonnet 5.5 a94632ea3d chore: delete code comments, add ratchet lint and ADRs
Classify every comment as tautology, stale, excuse or decision record.
Tautology/stale/excuse comments are deleted (excuses filed as issues
#196-#236), decisions moved to docs/adr/0001-0034.

- scripts/lint-comments.sh + .comment-baseline: per-file comment count
  may only go down; wired into tests/all.sh
- .claude/skills/delete-comment: repeatable audit workflow
- cargo fmt applied to touched crates

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 13:37:32 +01:00

28 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
set -eu
command -v ruff >/dev/null || { echo "skip: ruff not installed"; exit 0; }
root=$(cd "$(dirname "$0")/.." && pwd)
tmp=$(mktemp -d)
trap 'kill $srv 2>/dev/null; rm -rf "$tmp"' EXIT
port=$((20000 + $$ % 20000))
python3 "$root/tests/fake_m4.py" $port & srv=$!
mkdir -p "$tmp/home/.hx" "$tmp/repo"
echo '{"claude":{"access":"fake-token","refresh":"r","expires":99999999999999}}' > "$tmp/home/.hx/auth.json"
echo 'line-length = 100' > "$tmp/repo/ruff.toml"
printf '[lsp]\ndisable = ["pyright"]\n' > "$tmp/home/.hx/config.toml"
sleep 0.5
cd "$tmp/repo"
HOME="$tmp/home" HX_BASE_URL="http://127.0.0.1:$port" "$root/target/debug/hx" -p "go" > "$tmp/out" 2> "$tmp/err" || { cat "$tmp/err"; exit 1; }
log="$tmp/log.json"
curl -s "http://127.0.0.1:$port/" > "$log"
fail() { echo "FAIL: $1"; echo "--- log"; python3 -m json.tool < "$log"; echo "--- err"; cat "$tmp/err"; exit 1; }
chk() { python3 -c "import json,sys; l=json.load(open(sys.argv[1])); $1" "$log"; }
grep -q FINISHED "$tmp/out" || fail "no finish"
chk 'assert "[F401]" in l[1] and "(ruff)" in l[1], l[1]' || fail "no ruff finding"
grep -qx "x = 2" p.py && grep -qx "print(x)" p.py || fail "format/edit: $(cat p.py)"
chk 'assert l[2].startswith("OK:edited"), l[2]' || fail "edit blocked"
chk 'assert "OK:marked FalsePositive" in l[3], l[3]' || fail "mark"
grep -q F401 "$tmp"/home/.hx/projects/*/triage.json || fail "triage not persisted"
[ -s "$tmp/home/.hx/latency.log" ] || fail "no latency log"
echo "m4 e2e ok"