drep-ai 2.5.0

A local commit gate: runs the linters your repo configures, and sends changed code to an LLM for review
Documentation
//! Shared fixtures: tool specs and filesystem helpers.
//!
//! Wired in via `#[cfg(test)] mod tests;` in the parent module. These files were
//! orphaned once - present on disk but reachable by no `mod` declaration, so
//! cargo never compiled them and appending invalid Rust did not fail the build.
//! If you add a file here, declare it in this directory's `mod.rs`.

use crate::languages::spec::ToolSpec;

/// A minimal ruff-shaped spec for parser tests, avoiding the real
/// `definitions::RUFF` so the parser logic can be exercised without
/// needing ruff installed.
pub(crate) fn ruff_like_spec() -> ToolSpec {
    ToolSpec {
        name: "ruff",
        command: &["ruff", "check", "--output-format", "json"],
        local_paths: &["venv/bin/ruff"],
        config_files: &["pyproject.toml"],
        output_format: "json",
        diagnostics_stream: "stdout",
        ..ToolSpec::default()
    }
}

pub(crate) fn gofmt_like_spec() -> ToolSpec {
    ToolSpec {
        name: "gofmt",
        command: &["gofmt", "-l"],
        local_paths: &[],
        config_files: &["go.mod"],
        output_format: "lines",
        diagnostics_stream: "stdout",
        ..ToolSpec::default()
    }
}

pub(crate) fn go_vet_like_spec() -> ToolSpec {
    ToolSpec {
        name: "go vet",
        command: &["go", "vet"],
        local_paths: &[],
        config_files: &["go.mod"],
        output_format: "position",
        diagnostics_stream: "stderr",
        ..ToolSpec::default()
    }
}

pub(crate) fn tsc_like_spec() -> ToolSpec {
    ToolSpec {
        name: "tsc",
        command: &["tsc", "--noEmit", "--pretty", "false"],
        local_paths: &["node_modules/.bin/tsc"],
        config_files: &["tsconfig.json"],
        output_format: "tsc",
        diagnostics_stream: "stdout",
        ..ToolSpec::default()
    }
}

pub(crate) fn clippy_like_spec() -> ToolSpec {
    ToolSpec {
        name: "clippy",
        command: &["cargo", "clippy", "--message-format", "json"],
        local_paths: &[],
        config_files: &["Cargo.toml"],
        output_format: "cargo",
        diagnostics_stream: "stdout",
        ..ToolSpec::default()
    }
}

/// Re-exported so this suite's `use super::support::*` importers reach the
/// crate-wide helper rather than a local copy.
pub(crate) use crate::test_support::write_executable;