drep/languages/definitions/
swift.rs1use crate::languages::spec::{
4 DEFAULT_TOOL_TIMEOUT_SECS, DiagnosticsStream, LanguageSupport, OutputFormat, ToolSpec,
5};
6
7pub static SWIFTLINT: ToolSpec = ToolSpec {
14 name: "swiftlint",
15 command: &["swiftlint", "lint", "--reporter", "sarif", "--quiet"],
16 local_paths: &[],
17 config_files: &[".swiftlint.yml"],
18 config_flag: None,
19 output_format: OutputFormat::Sarif,
20 diagnostics_stream: DiagnosticsStream::Stdout,
21 timeout_secs: DEFAULT_TOOL_TIMEOUT_SECS,
22 timeout_context: None,
23 establishes_compilation: false,
24 serial_in_repository: false,
25 accepts_files: true,
26};
27
28pub static SWIFT: LanguageSupport = LanguageSupport {
30 name: "swift",
31 display_name: "Swift",
32 extensions: &[".swift"],
33 filenames: &[],
34 filename_prefixes: &[],
35 tools: &[&SWIFTLINT],
36 conventions: &[
37 "Force unwraps and force tries on values that can be nil or throw",
38 "Retain cycles from closures capturing self strongly",
39 "Unowned references that outlive their target",
40 "Main-actor isolation violated from a synchronous context",
41 ],
42 vendored_dirs: &[".build", "Pods", "DerivedData"],
43};
44
45pub(crate) static FAMILY: &[&LanguageSupport] = &[&SWIFT];