feat(lint): wire Vale as deterministic prefilter for skill-audit/agent-audit #85
@@ -10,11 +10,17 @@ set -euo pipefail
|
|||||||
# only one of the two. Run from repo root or pass REPO_ROOT as arg.
|
# only one of the two. Run from repo root or pass REPO_ROOT as arg.
|
||||||
|
|
||||||
REPO_ROOT="${1:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
|
REPO_ROOT="${1:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
|
||||||
|
# A nonexistent REPO_ROOT must fail loudly, not fall through to the "neither
|
||||||
|
# copy present" no-op below — that guard exists for a repo that legitimately
|
||||||
|
# has no kyberforge plugin installed, not for a typo'd or stale path, and a
|
||||||
|
# clean exit 0 here would read as "checked, in sync" when nothing ran at all.
|
||||||
|
if [[ ! -d "$REPO_ROOT" ]]; then
|
||||||
|
echo "Vale style sync check failed: REPO_ROOT '$REPO_ROOT' is not a directory." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
# Absolutized because the glob probe below `cd`s into a scratch tree, where a
|
# Absolutized because the glob probe below `cd`s into a scratch tree, where a
|
||||||
# relative --config path would stop resolving.
|
# relative --config path would stop resolving.
|
||||||
if [[ -d "$REPO_ROOT" ]]; then
|
|
||||||
REPO_ROOT="$(cd "$REPO_ROOT" && pwd)"
|
REPO_ROOT="$(cd "$REPO_ROOT" && pwd)"
|
||||||
fi
|
|
||||||
FAIL=0
|
FAIL=0
|
||||||
|
|
||||||
err() { echo " FAIL: $1" >&2; FAIL=$((FAIL + 1)); }
|
err() { echo " FAIL: $1" >&2; FAIL=$((FAIL + 1)); }
|
||||||
|
|||||||
@@ -123,6 +123,19 @@ else
|
|||||||
fail "exited non-zero when skill-audit/agent-audit are simply absent"
|
fail "exited non-zero when skill-audit/agent-audit are simply absent"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# --- 5b. Exits 1 when REPO_ROOT does not exist ---
|
||||||
|
# A nonexistent path used to fall through to the "neither copy present" no-op
|
||||||
|
# (test 5 above) and exit 0 — indistinguishable from a real, verified in-sync
|
||||||
|
# result. That guard is for a repo legitimately missing kyberforge, not a
|
||||||
|
# typo'd or stale path.
|
||||||
|
echo ""
|
||||||
|
echo "--- exits 1 when REPO_ROOT does not exist ---"
|
||||||
|
if bash "$SCRIPT" "/nonexistent/path/$(date +%s)-$$" > /dev/null 2>&1; then
|
||||||
|
fail "exited 0 for a nonexistent REPO_ROOT — expected exit 1"
|
||||||
|
else
|
||||||
|
pass "exits non-zero for a nonexistent REPO_ROOT"
|
||||||
|
fi
|
||||||
|
|
||||||
# --- 6. Exits 1 when only one of the two copies is present ---
|
# --- 6. Exits 1 when only one of the two copies is present ---
|
||||||
# The no-op guard used `||`, so a single missing copy also exited 0 — a deleted
|
# The no-op guard used `||`, so a single missing copy also exited 0 — a deleted
|
||||||
# or renamed copy passed the sync check silently.
|
# or renamed copy passed the sync check silently.
|
||||||
|
|||||||
Reference in New Issue
Block a user