use crate::languages::spec::ToolSpec;
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()
}
}
pub(crate) use crate::test_support::write_executable;
pub(crate) fn checkstyle_like_spec() -> ToolSpec {
ToolSpec {
name: "checkstyle",
command: &["checkstyle", "-f", "sarif"],
local_paths: &[],
config_files: &["checkstyle.xml"],
config_flag: Some("-c"),
output_format: "sarif",
diagnostics_stream: "stdout",
..ToolSpec::default()
}
}
pub(crate) fn ktlint_like_spec() -> ToolSpec {
ToolSpec {
name: "ktlint",
command: &["ktlint", "--log-level=none", "--reporter=json"],
local_paths: &[],
config_files: &[".editorconfig"],
output_format: "ktlint",
diagnostics_stream: "stdout",
..ToolSpec::default()
}
}