4NK_template/scripts/agents/qualite_formelle.sh

40 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
# Chargement env utilisateur (~/.4nk_template/.env)
"$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/env/ensure_env.sh" || true
if [[ -f "${HOME}/.4nk_template/.env" ]]; then
set -a
. "${HOME}/.4nk_template/.env"
set +a
fi
TARGET_DIR="${1:-.}"
OUTPUT_DIR="${2:-tests/reports/agents}"
mkdir -p "$OUTPUT_DIR"
SUMMARY_FILE="$OUTPUT_DIR/qualite_formelle.md"
echo "# Agent Qualité formelle" > "$SUMMARY_FILE"
echo >> "$SUMMARY_FILE"
# Contrôles basiques
issues=0
pushd "$TARGET_DIR" >/dev/null
if grep -R "RESUME" docs/ >/dev/null 2>&1; then
echo "- Placeholder 'RESUME' détecté dans docs/ (à remplacer)." >> "$SUMMARY_FILE"; issues=$((issues+1))
fi
echo "## Résultats locaux" >> "$SUMMARY_FILE"
if [[ $issues -eq 0 ]]; then
echo "- Aucun problème formel bloquant détecté." >> "$SUMMARY_FILE"
fi
PROMPT=$(cat <<'EOF'
Évalue la qualité formelle (français uniquement, typographie, absence dexemples applicatifs, intro/conclusion) et propose 5 recommandations priorisées.
EOF
)
scripts/agents/ai_prompt.sh "$PROMPT" >> "$SUMMARY_FILE" || true
echo "Rapport: $SUMMARY_FILE"
popd >/dev/null