agent/codex/qa/scripts/qa.sh
Snider 466fe9f5a6 feat(codex): mirror claude plugins and ethics modal
Summary:\n- added Codex marketplace registry plus awareness/ethics/guardrails sub-plugins\n- mirrored Claude plugin commands/scripts/hooks into codex api/ci/code/collect/coolify/core/issue/perf/qa/review/verify\n- embedded Axioms of Life ethics modal, guardrails, and kernel files under codex/ethics\n- added Codex parity report, improvements list, and MCP integration plan\n- extended Gemini MCP tools and docs for Codex awareness
2026-02-05 20:13:01 +00:00

89 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
# Core QA command logic
# --- Flags ---
FIX=false
QUICK=false
while [[ "$#" -gt 0 ]]; do
case "$1" in
--fix)
FIX=true
shift
;;
--quick)
QUICK=true
shift
;;
*)
# Unknown arg, shift past it
shift
;;
esac
done
# --- Project Detection ---
PROJECT_TYPE=""
if [ -f "go.mod" ]; then
PROJECT_TYPE="go"
elif [ -f "composer.json" ]; then
PROJECT_TYPE="php"
else
echo "Could not determine project type (go.mod or composer.json not found)."
exit 1
fi
# --- QA Functions ---
run_qa() {
if [ "$PROJECT_TYPE" = "go" ]; then
core go qa
else
core php qa
fi
}
run_lint() {
if [ "$PROJECT_TYPE" = "go" ]; then
core go lint
else
core php pint --test
fi
}
run_fix() {
if [ "$PROJECT_TYPE" = "go" ]; then
core go fmt
else
core php pint
fi
}
# --- Main Logic ---
if [ "$QUICK" = true ]; then
echo "Running in --quick mode (lint only)..."
run_lint
exit $?
fi
echo "Running QA for $PROJECT_TYPE project..."
MAX_ITERATIONS=3
for i in $(seq 1 $MAX_ITERATIONS); do
echo "--- Iteration $i ---"
run_qa
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "✓ QA Passed"
exit 0
fi
if [ "$FIX" = false ]; then
echo "✗ QA Failed"
exit $EXIT_CODE
fi
echo "QA failed. Attempting to fix..."
run_fix
done
echo "✗ QA failed after $MAX_ITERATIONS iterations."
exit 1