(path: &Path)
| 962 | } |
| 963 | |
| 964 | fn infer_language_id(path: &Path) -> &'static str { |
| 965 | match path |
| 966 | .extension() |
| 967 | .and_then(|s| s.to_str()) |
| 968 | .unwrap_or_default() |
| 969 | .to_ascii_lowercase() |
| 970 | .as_str() |
| 971 | { |
| 972 | "rs" => "rust", |
| 973 | "ts" | "mts" | "cts" => "typescript", |
| 974 | "tsx" => "typescriptreact", |
| 975 | "js" | "mjs" | "cjs" => "javascript", |
| 976 | "jsx" => "javascriptreact", |
| 977 | "py" => "python", |
| 978 | "go" => "go", |
| 979 | "java" => "java", |
| 980 | "kt" => "kotlin", |
| 981 | "swift" => "swift", |
| 982 | "cpp" | "cc" | "cxx" | "c" | "h" | "hpp" => "cpp", |
| 983 | "json" => "json", |
| 984 | "md" => "markdown", |
| 985 | "yaml" | "yml" => "yaml", |
| 986 | "toml" => "toml", |
| 987 | "sh" | "bash" | "zsh" => "shellscript", |
| 988 | _ => "plaintext", |
| 989 | } |
| 990 | } |
| 991 | |
| 992 | fn append_cli_file_attachments(input: &mut String, files: &[PathBuf]) -> anyhow::Result<()> { |
| 993 | for file_path in files { |
no test coverage detected