use crate::languages::spec::{
DEFAULT_TOOL_TIMEOUT_SECS, DiagnosticsStream, LanguageSupport, OutputFormat, ToolSpec,
};
pub static GOFMT: ToolSpec = ToolSpec {
name: "gofmt",
command: &["gofmt", "-l"],
local_paths: &[],
config_files: &["go.mod"],
config_flag: None,
output_format: OutputFormat::Lines,
diagnostics_stream: DiagnosticsStream::Stdout,
timeout_secs: DEFAULT_TOOL_TIMEOUT_SECS,
timeout_context: None,
establishes_compilation: false,
serial_in_repository: false,
accepts_files: true,
};
pub static GO_VET: ToolSpec = ToolSpec {
name: "go vet",
command: &["go", "vet"],
local_paths: &[],
config_files: &["go.mod"],
config_flag: None,
output_format: OutputFormat::Position,
diagnostics_stream: DiagnosticsStream::Stderr,
timeout_secs: DEFAULT_TOOL_TIMEOUT_SECS,
timeout_context: None,
establishes_compilation: true,
serial_in_repository: false,
accepts_files: true,
};
pub static GO: LanguageSupport = LanguageSupport {
name: "go",
display_name: "Go",
extensions: &[".go"],
filenames: &[],
filename_prefixes: &[],
tools: &[&GOFMT, &GO_VET],
conventions: &[
"Errors ignored rather than checked and wrapped",
"Goroutine leaks, and writes to a channel nobody reads",
"defer inside a loop, and defer that never runs",
"Data races on shared state without synchronisation",
],
vendored_dirs: &["vendor"],
};
pub(crate) static FAMILY: &[&LanguageSupport] = &[&GO];