pub struct ToolSpec {
pub name: &'static str,
pub command: &'static [&'static str],
pub local_paths: &'static [&'static str],
pub config_files: &'static [&'static str],
pub config_flag: Option<&'static str>,
pub output_format: OutputFormat,
pub diagnostics_stream: DiagnosticsStream,
pub timeout_secs: u64,
pub timeout_context: Option<&'static str>,
pub establishes_compilation: bool,
pub serial_in_repository: bool,
pub accepts_files: bool,
}Expand description
A deterministic checker for one language.
Attributes:
name: Tool name, used in logs and finding provenance.
command: argv to run, minus the files. The first element is resolved
against local_paths before PATH.
local_paths: Repo-relative locations to prefer over PATH, so a project
gets the version its own CI runs (node_modules/.bin/eslint rather
than whatever is installed globally).
config_files: Repo-relative paths that mean “this project has opted
into this tool”. A tool with none of them present is skipped: its
defaults are not the project’s chosen style, so running it anyway
would invent findings the project never asked for.
config_flag: Flag that hands the discovered config file to the tool,
for the checkers that will not look for it themselves.
output_format: How to parse the tool’s diagnostics into findings.
diagnostics_stream: Which stream carries them. go vet writes to
stderr, so reading only stdout would report every Go file clean.
Fields§
§name: &'static strTool name, used in logs and finding provenance.
command: &'static [&'static str]argv to run, minus the files. The first element is resolved against local_paths before PATH.
local_paths: &'static [&'static str]Repo-relative locations to prefer over PATH, so a project gets the
version its own CI runs (node_modules/.bin/eslint rather than
whatever is installed globally).
config_files: &'static [&'static str]Repo-relative paths that mean “this project has opted into this tool”. A tool with none of them present is skipped: its defaults are not the project’s chosen style, so running it anyway would invent findings the project never asked for.
config_flag: Option<&'static str>Flag that hands the discovered config file to the tool, e.g. "-c".
Most checkers find their own config: ruff reads pyproject.toml out of
the working directory without being told. The JVM linters do not.
checkstyle run bare exits 1 with “Must specify a config XML”, so
without this it could not run at all. When set, the config path
config_files already discovered is appended as
[config_flag, <path>] ahead of the file arguments.
output_format: OutputFormatHow to parse the tool’s diagnostics into findings.
diagnostics_stream: DiagnosticsStreamWhich stream carries them.
timeout_secs: u64Wall-clock ceiling for the process. This includes any tool-owned lock wait before analysis starts.
timeout_context: Option<&'static str>Optional diagnostic suffix explaining a legitimate long wait.
establishes_compilation: boolA zero-exit run proves the checked files compiled/typechecked.
serial_in_repository: boolWhether invocations of this tool must be serialized within a repo.
accepts_files: boolWhether the tool accepts file paths as arguments.
cargo clippy does not: it checks a crate, and a path argument is
rejected outright with “unexpected argument”. Appending files to it
therefore made every run fail, so every Rust file came back
Unavailable and drep check exited 2 on any Rust repository - the
deterministic half for Rust never ran at all.
A tool with accepts_files: false is invoked bare and reports on the
whole project, so its findings are filtered down to the files actually
being checked. Without that filter a commit gate would block on
pre-existing issues in code the commit never touched.