chore(config): add gdlint + gdformat + cargo-deny to pre-push hook

Pre-push now runs 6 checks:
- GDScript: parse check, gdlint (static analysis), gdformat (style)
- Rust: clippy, fmt, cargo deny (license/advisory/deps)
All tools degrade gracefully if not installed.

Also files Q-065 through Q-080: shooting mechanics, procedural terrain,
cloth sim, vehicle physics, PathMesh3D, NobodyWho vs voice pipeline,
BitTorrent distribution, BehaviourToolkit patterns, screenshot manager,
RichText3D, DeformableMesh, GridMapLayer, mod loader, god rays,
Steam multiplayer, CityCrafter3D, planet generator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 19:06:03 +01:00
co-authored by Claude Opus 4.6
parent ec88afaf07
commit 4d1a29bcc1
2 changed files with 149 additions and 5 deletions
+36 -4
View File
@@ -8,20 +8,42 @@ ERRORS=0
echo "pre-push: running lint checks..."
# --- GDScript lint (headless Godot parse check) ---
# --- GDScript parse check (headless Godot) ---
GODOT="${GODOT:-godot}"
if command -v "$GODOT" >/dev/null 2>&1; then
echo "pre-push: checking GDScript..."
echo "pre-push: checking GDScript (parse)..."
SCRIPT_ERRORS=$("$GODOT" --headless --path "$REPO_ROOT/client" --quit 2>&1 | grep -ci "SCRIPT ERROR" || true)
if [ "$SCRIPT_ERRORS" -gt 0 ]; then
echo "pre-push: FAIL — $SCRIPT_ERRORS GDScript error(s) found"
"$GODOT" --headless --path "$REPO_ROOT/client" --quit 2>&1 | grep -i "SCRIPT ERROR"
ERRORS=$((ERRORS + 1))
else
echo "pre-push: GDScript — OK"
echo "pre-push: GDScript parse — OK"
fi
else
echo "pre-push: WARNING — Godot not found, skipping GDScript lint"
echo "pre-push: WARNING — Godot not found, skipping GDScript parse check"
fi
# --- GDScript lint (gdlint static analysis) — advisory only until codebase is clean ---
if command -v gdlint >/dev/null 2>&1; then
echo "pre-push: checking GDScript (gdlint — advisory)..."
LINT_COUNT=$(gdlint "$REPO_ROOT/client/scripts/" "$REPO_ROOT/client/ui/" 2>&1 | grep -c "Error:" || true)
if [ "$LINT_COUNT" -gt 0 ]; then
echo "pre-push: gdlint — $LINT_COUNT issue(s) (advisory, not blocking)"
else
echo "pre-push: gdlint — OK"
fi
fi
# --- GDScript format check (gdformat) — advisory only until codebase is clean ---
if command -v gdformat >/dev/null 2>&1; then
echo "pre-push: checking GDScript (gdformat — advisory)..."
FORMAT_COUNT=$(gdformat --check "$REPO_ROOT/client/scripts/" "$REPO_ROOT/client/ui/" 2>&1 | grep -c "would reformat" || true)
if [ "$FORMAT_COUNT" -gt 0 ]; then
echo "pre-push: gdformat — $FORMAT_COUNT file(s) need formatting (advisory, not blocking)"
else
echo "pre-push: gdformat — OK"
fi
fi
# --- Rust lint (clippy + fmt) ---
@@ -39,6 +61,16 @@ if command -v cargo >/dev/null 2>&1 && [ -d "$REPO_ROOT/server" ]; then
else
echo "pre-push: fmt — OK"
fi
# --- Rust dependency audit (cargo deny) — requires deny.toml config ---
if command -v cargo-deny >/dev/null 2>&1 && [ -f "$REPO_ROOT/server/deny.toml" ]; then
echo "pre-push: checking Rust (cargo deny)..."
if ! (cd "$REPO_ROOT/server" && cargo deny check 2>&1); then
ERRORS=$((ERRORS + 1))
else
echo "pre-push: cargo deny — OK"
fi
fi
else
echo "pre-push: WARNING — cargo not found or server/ missing, skipping Rust lint"
fi