diff --git a/script/test b/script/test index 19d66e40..e5e6dd76 100755 --- a/script/test +++ b/script/test @@ -4,6 +4,9 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +echo "=== Running cargo clippy ===" +cargo clippy --manifest-path "$PROJECT_ROOT/Cargo.toml" --all-targets --all-features + echo "=== Running Rust tests ===" cargo test --manifest-path "$PROJECT_ROOT/Cargo.toml" diff --git a/server/src/agents/gates.rs b/server/src/agents/gates.rs index 9c46bd35..7679e73f 100644 --- a/server/src/agents/gates.rs +++ b/server/src/agents/gates.rs @@ -171,39 +171,12 @@ fn run_command_with_timeout( /// otherwise `cargo nextest run` / `cargo test`) in the given directory. /// Returns `(gates_passed, combined_output)`. pub(crate) fn run_acceptance_gates(path: &Path) -> Result<(bool, String), String> { - let mut all_output = String::new(); - let mut all_passed = true; - - // ── cargo clippy ────────────────────────────────────────────── - let clippy = Command::new("cargo") - .args(["clippy", "--all-targets", "--all-features"]) - .current_dir(path) - .output() - .map_err(|e| format!("Failed to run cargo clippy: {e}"))?; - - all_output.push_str("=== cargo clippy ===\n"); - let clippy_stdout = String::from_utf8_lossy(&clippy.stdout); - let clippy_stderr = String::from_utf8_lossy(&clippy.stderr); - if !clippy_stdout.is_empty() { - all_output.push_str(&clippy_stdout); - } - if !clippy_stderr.is_empty() { - all_output.push_str(&clippy_stderr); - } - all_output.push('\n'); - - if !clippy.status.success() { - all_passed = false; - } - - // ── tests (script/test if available, else cargo nextest/test) ─ + // Run script/test (or fallback to cargo test). This is the sole + // acceptance gate — project-specific linting and test commands belong + // in script/test, not hardcoded here. let (test_success, test_out) = run_project_tests(path)?; - all_output.push_str(&test_out); - if !test_success { - all_passed = false; - } - Ok((all_passed, all_output)) + Ok((test_success, test_out)) } /// Run `script/test_coverage` in the given directory if the script exists.