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 output_format: &'static str,
pub diagnostics_stream: &'static str,
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.
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.
output_format: &'static strHow to parse the tool’s diagnostics into findings.
diagnostics_stream: &'static strWhich stream carries them. go vet writes to stderr, so reading only
stdout would report every Go file clean.
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.