fix: lowercase filename when checking for language_id
@@ -240,11 +240,15 @@ pub fn language_id_from_path(path: &Path) -> Option<&'static str> {
}
}
// Handle paths without extension
+ #[allow(clippy::match_single_binding)]
None => match path.file_name()?.to_str()? {
+ // case-insensitive matching
+ filename => match filename.to_lowercase().as_str() {
"dockerfile" => "dockerfile",
"makefile" | "gnumakefile" => "makefile",
_ => return None,
},
+ },
})
}
