drep/languages/definitions/
rust.rs1use crate::languages::spec::{DiagnosticsStream, LanguageSupport, OutputFormat, ToolSpec};
4
5pub static CLIPPY: ToolSpec = ToolSpec {
7 name: "clippy",
8 command: &["cargo", "clippy", "--message-format", "json", "--quiet"],
9 local_paths: &[],
10 config_files: &["Cargo.toml"],
11 config_flag: None,
12 output_format: OutputFormat::Cargo,
13 diagnostics_stream: DiagnosticsStream::Stdout,
14 timeout_secs: 1_800,
18 timeout_context: Some(", including its Cargo build-lock wait"),
19 establishes_compilation: true,
20 serial_in_repository: true,
21 accepts_files: false,
24};
25
26pub static RUST_LANG: LanguageSupport = LanguageSupport {
28 name: "rust",
29 display_name: "Rust",
30 extensions: &[".rs"],
31 filenames: &[],
32 filename_prefixes: &[],
33 tools: &[&CLIPPY],
34 conventions: &[
35 "unwrap/expect on values that can legitimately be None or Err",
36 "unsafe blocks, and whether their invariants are documented",
37 "Unnecessary clones and allocations in hot paths",
38 "Send/Sync correctness for types crossing threads",
39 ],
40 vendored_dirs: &["target"],
41};
42
43pub(crate) static FAMILY: &[&LanguageSupport] = &[&RUST_LANG];