fix(lint): fail the style-sync check when one copy is missing
The guard used `||`, so exactly one of the two audit skill directories missing also exited 0, where the intended silent no-op is both absent. A renamed skill-audit reported green instead of flagging that a canonical style copy had lost its counterpart. One-present now exits 1 naming the missing side and the remedy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MCQ648fLSFXPHGZdQ8gn58
This commit is contained in:
@@ -17,10 +17,22 @@ err() { echo " FAIL: $1" >&2; FAIL=$((FAIL + 1)); }
|
||||
SKILL_AUDIT="$REPO_ROOT/plugins/kyberforge/skills/skill-audit"
|
||||
AGENT_AUDIT="$REPO_ROOT/plugins/kyberforge/skills/agent-audit"
|
||||
|
||||
if [[ ! -d "$SKILL_AUDIT" || ! -d "$AGENT_AUDIT" ]]; then
|
||||
if [[ ! -d "$SKILL_AUDIT" && ! -d "$AGENT_AUDIT" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Exactly one present is drift, not absence: the missing copy can't be in sync
|
||||
# with the surviving one, and treating it as a no-op is how a deleted or
|
||||
# renamed copy would slip through silently.
|
||||
if [[ ! -d "$SKILL_AUDIT" ]]; then
|
||||
echo "Vale style sync check failed: $AGENT_AUDIT exists but $SKILL_AUDIT does not — run scripts/sync-vale-styles.sh to regenerate skill-audit's copy." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d "$AGENT_AUDIT" ]]; then
|
||||
echo "Vale style sync check failed: $SKILL_AUDIT exists but $AGENT_AUDIT does not — agent-audit holds the canonical copy, so restore it before syncing." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! diff -q "$SKILL_AUDIT/scripts/vale-wrap.sh" "$AGENT_AUDIT/scripts/vale-wrap.sh" >/dev/null 2>&1; then
|
||||
err "scripts/vale-wrap.sh differs between skill-audit and agent-audit"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user