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