file_identify/
extensions.rs

1use crate::tags::TagSet;
2use std::collections::{HashMap, HashSet};
3
4lazy_static::lazy_static! {
5    pub static ref EXTENSIONS: HashMap<&'static str, TagSet> = {
6        let mut map = HashMap::new();
7
8        map.insert("adoc", HashSet::from(["text", "asciidoc"]));
9        map.insert("ai", HashSet::from(["binary", "adobe-illustrator"]));
10        map.insert("aj", HashSet::from(["text", "aspectj"]));
11        map.insert("asciidoc", HashSet::from(["text", "asciidoc"]));
12        map.insert("apinotes", HashSet::from(["text", "apinotes"]));
13        map.insert("asar", HashSet::from(["binary", "asar"]));
14        map.insert("asm", HashSet::from(["text", "asm"]));
15        map.insert("astro", HashSet::from(["text", "astro"]));
16        map.insert("avif", HashSet::from(["binary", "image", "avif"]));
17        map.insert("avsc", HashSet::from(["text", "avro-schema"]));
18        map.insert("bash", HashSet::from(["text", "shell", "bash"]));
19        map.insert("bat", HashSet::from(["text", "batch"]));
20        map.insert("bats", HashSet::from(["text", "shell", "bash", "bats"]));
21        map.insert("bazel", HashSet::from(["text", "bazel"]));
22        map.insert("bb", HashSet::from(["text", "bitbake"]));
23        map.insert("bbappend", HashSet::from(["text", "bitbake"]));
24        map.insert("bbclass", HashSet::from(["text", "bitbake"]));
25        map.insert("beancount", HashSet::from(["text", "beancount"]));
26        map.insert("bib", HashSet::from(["text", "bib"]));
27        map.insert("bmp", HashSet::from(["binary", "image", "bitmap"]));
28        map.insert("bz2", HashSet::from(["binary", "bzip2"]));
29        map.insert("bz3", HashSet::from(["binary", "bzip3"]));
30        map.insert("bzl", HashSet::from(["text", "bazel"]));
31        map.insert("c", HashSet::from(["text", "c"]));
32        map.insert("c++", HashSet::from(["text", "c++"]));
33        map.insert("c++m", HashSet::from(["text", "c++"]));
34        map.insert("cc", HashSet::from(["text", "c++"]));
35        map.insert("ccm", HashSet::from(["text", "c++"]));
36        map.insert("cfg", HashSet::from(["text"]));
37        map.insert("chs", HashSet::from(["text", "c2hs"]));
38        map.insert("cjs", HashSet::from(["text", "javascript"]));
39        map.insert("clj", HashSet::from(["text", "clojure"]));
40        map.insert("cljc", HashSet::from(["text", "clojure"]));
41        map.insert("cljs", HashSet::from(["text", "clojure", "clojurescript"]));
42        map.insert("cmake", HashSet::from(["text", "cmake"]));
43        map.insert("cnf", HashSet::from(["text"]));
44        map.insert("coffee", HashSet::from(["text", "coffee"]));
45        map.insert("conf", HashSet::from(["text"]));
46        map.insert("cpp", HashSet::from(["text", "c++"]));
47        map.insert("cppm", HashSet::from(["text", "c++"]));
48        map.insert("cr", HashSet::from(["text", "crystal"]));
49        map.insert("crt", HashSet::from(["text", "pem"]));
50        map.insert("cs", HashSet::from(["text", "c#"]));
51        map.insert("csproj", HashSet::from(["text", "xml", "csproj", "msbuild"]));
52        map.insert("csh", HashSet::from(["text", "shell", "csh"]));
53        map.insert("cson", HashSet::from(["text", "cson"]));
54        map.insert("css", HashSet::from(["text", "css"]));
55        map.insert("csv", HashSet::from(["text", "csv"]));
56        map.insert("csx", HashSet::from(["text", "c#", "c#script"]));
57        map.insert("cu", HashSet::from(["text", "cuda"]));
58        map.insert("cue", HashSet::from(["text", "cue"]));
59        map.insert("cuh", HashSet::from(["text", "cuda"]));
60        map.insert("cxx", HashSet::from(["text", "c++"]));
61        map.insert("cxxm", HashSet::from(["text", "c++"]));
62        map.insert("cylc", HashSet::from(["text", "cylc"]));
63        map.insert("dart", HashSet::from(["text", "dart"]));
64        map.insert("dbc", HashSet::from(["text", "dbc"]));
65        map.insert("def", HashSet::from(["text", "def"]));
66        map.insert("dll", HashSet::from(["binary"]));
67        map.insert("dtd", HashSet::from(["text", "dtd"]));
68        map.insert("ear", HashSet::from(["binary", "zip", "jar"]));
69        map.insert("edn", HashSet::from(["text", "clojure", "edn"]));
70        map.insert("ejs", HashSet::from(["text", "ejs"]));
71        map.insert("ejson", HashSet::from(["text", "json", "ejson"]));
72        map.insert("elm", HashSet::from(["text", "elm"]));
73        map.insert("env", HashSet::from(["text", "dotenv"]));
74        map.insert("eot", HashSet::from(["binary", "eot"]));
75        map.insert("eps", HashSet::from(["binary", "eps"]));
76        map.insert("erb", HashSet::from(["text", "erb"]));
77        map.insert("erl", HashSet::from(["text", "erlang"]));
78        map.insert("ex", HashSet::from(["text", "elixir"]));
79        map.insert("exe", HashSet::from(["binary"]));
80        map.insert("exs", HashSet::from(["text", "elixir"]));
81        map.insert("eyaml", HashSet::from(["text", "yaml"]));
82        map.insert("f03", HashSet::from(["text", "fortran"]));
83        map.insert("f08", HashSet::from(["text", "fortran"]));
84        map.insert("f90", HashSet::from(["text", "fortran"]));
85        map.insert("f95", HashSet::from(["text", "fortran"]));
86        map.insert("feature", HashSet::from(["text", "gherkin"]));
87        map.insert("fish", HashSet::from(["text", "fish"]));
88        map.insert("fits", HashSet::from(["binary", "fits"]));
89        map.insert("fs", HashSet::from(["text", "f#"]));
90        map.insert("fsproj", HashSet::from(["text", "xml", "fsproj", "msbuild"]));
91        map.insert("fsx", HashSet::from(["text", "f#", "f#script"]));
92        map.insert("gd", HashSet::from(["text", "gdscript"]));
93        map.insert("gemspec", HashSet::from(["text", "ruby"]));
94        map.insert("geojson", HashSet::from(["text", "geojson", "json"]));
95        map.insert("ggb", HashSet::from(["binary", "zip", "ggb"]));
96        map.insert("gif", HashSet::from(["binary", "image", "gif"]));
97        map.insert("gleam", HashSet::from(["text", "gleam"]));
98        map.insert("go", HashSet::from(["text", "go"]));
99        map.insert("gotmpl", HashSet::from(["text", "gotmpl"]));
100        map.insert("gpx", HashSet::from(["text", "gpx", "xml"]));
101        map.insert("graphql", HashSet::from(["text", "graphql"]));
102        map.insert("gradle", HashSet::from(["text", "groovy"]));
103        map.insert("groovy", HashSet::from(["text", "groovy"]));
104        map.insert("gyb", HashSet::from(["text", "gyb"]));
105        map.insert("gyp", HashSet::from(["text", "gyp", "python"]));
106        map.insert("gypi", HashSet::from(["text", "gyp", "python"]));
107        map.insert("gz", HashSet::from(["binary", "gzip"]));
108        map.insert("h", HashSet::from(["text", "header", "c", "c++"]));
109        map.insert("hbs", HashSet::from(["text", "handlebars"]));
110        map.insert("hcl", HashSet::from(["text", "hcl"]));
111        map.insert("hh", HashSet::from(["text", "header", "c++"]));
112        map.insert("hpp", HashSet::from(["text", "header", "c++"]));
113        map.insert("hrl", HashSet::from(["text", "erlang"]));
114        map.insert("hs", HashSet::from(["text", "haskell"]));
115        map.insert("htm", HashSet::from(["text", "html"]));
116        map.insert("html", HashSet::from(["text", "html"]));
117        map.insert("hxx", HashSet::from(["text", "header", "c++"]));
118        map.insert("icns", HashSet::from(["binary", "icns"]));
119        map.insert("ico", HashSet::from(["binary", "icon"]));
120        map.insert("ics", HashSet::from(["text", "icalendar"]));
121        map.insert("idl", HashSet::from(["text", "idl"]));
122        map.insert("idr", HashSet::from(["text", "idris"]));
123        map.insert("inc", HashSet::from(["text", "inc"]));
124        map.insert("ini", HashSet::from(["text", "ini"]));
125        map.insert("inl", HashSet::from(["text", "inl", "c++"]));
126        map.insert("ino", HashSet::from(["text", "ino", "c++"]));
127        map.insert("inx", HashSet::from(["text", "xml", "inx"]));
128        map.insert("ipynb", HashSet::from(["text", "jupyter", "json"]));
129        map.insert("ixx", HashSet::from(["text", "c++"]));
130        map.insert("j2", HashSet::from(["text", "jinja"]));
131        map.insert("jade", HashSet::from(["text", "jade"]));
132        map.insert("jar", HashSet::from(["binary", "zip", "jar"]));
133        map.insert("java", HashSet::from(["text", "java"]));
134        map.insert("jenkins", HashSet::from(["text", "groovy", "jenkins"]));
135        map.insert("jenkinsfile", HashSet::from(["text", "groovy", "jenkins"]));
136        map.insert("jinja", HashSet::from(["text", "jinja"]));
137        map.insert("jinja2", HashSet::from(["text", "jinja"]));
138        map.insert("jl", HashSet::from(["text", "julia"]));
139        map.insert("jpeg", HashSet::from(["binary", "image", "jpeg"]));
140        map.insert("jpg", HashSet::from(["binary", "image", "jpeg"]));
141        map.insert("js", HashSet::from(["text", "javascript"]));
142        map.insert("json", HashSet::from(["text", "json"]));
143        map.insert("jsonld", HashSet::from(["text", "json", "jsonld"]));
144        map.insert("jsonnet", HashSet::from(["text", "jsonnet"]));
145        map.insert("json5", HashSet::from(["text", "json5"]));
146        map.insert("jsx", HashSet::from(["text", "jsx"]));
147        map.insert("key", HashSet::from(["text", "pem"]));
148        map.insert("kml", HashSet::from(["text", "kml", "xml"]));
149        map.insert("kt", HashSet::from(["text", "kotlin"]));
150        map.insert("kts", HashSet::from(["text", "kotlin"]));
151        map.insert("lean", HashSet::from(["text", "lean"]));
152        map.insert("lektorproject", HashSet::from(["text", "ini", "lektorproject"]));
153        map.insert("less", HashSet::from(["text", "less"]));
154        map.insert("lfm", HashSet::from(["text", "lazarus", "lazarus-form"]));
155        map.insert("lhs", HashSet::from(["text", "literate-haskell"]));
156        map.insert("libsonnet", HashSet::from(["text", "jsonnet"]));
157        map.insert("lidr", HashSet::from(["text", "idris"]));
158        map.insert("liquid", HashSet::from(["text", "liquid"]));
159        map.insert("lpi", HashSet::from(["text", "lazarus", "xml"]));
160        map.insert("lpr", HashSet::from(["text", "lazarus", "pascal"]));
161        map.insert("lr", HashSet::from(["text", "lektor"]));
162        map.insert("lua", HashSet::from(["text", "lua"]));
163        map.insert("m", HashSet::from(["text", "objective-c"]));
164        map.insert("m4", HashSet::from(["text", "m4"]));
165        map.insert("magik", HashSet::from(["text", "magik"]));
166        map.insert("make", HashSet::from(["text", "makefile"]));
167        map.insert("manifest", HashSet::from(["text", "manifest"]));
168        map.insert("map", HashSet::from(["text", "map"]));
169        map.insert("markdown", HashSet::from(["text", "markdown"]));
170        map.insert("md", HashSet::from(["text", "markdown"]));
171        map.insert("mdx", HashSet::from(["text", "mdx"]));
172        map.insert("meson", HashSet::from(["text", "meson"]));
173        map.insert("metal", HashSet::from(["text", "metal"]));
174        map.insert("mib", HashSet::from(["text", "mib"]));
175        map.insert("mjs", HashSet::from(["text", "javascript"]));
176        map.insert("mk", HashSet::from(["text", "makefile"]));
177        map.insert("ml", HashSet::from(["text", "ocaml"]));
178        map.insert("mli", HashSet::from(["text", "ocaml"]));
179        map.insert("mm", HashSet::from(["text", "c++", "objective-c++"]));
180        map.insert("modulemap", HashSet::from(["text", "modulemap"]));
181        map.insert("mscx", HashSet::from(["text", "xml", "musescore"]));
182        map.insert("mscz", HashSet::from(["binary", "zip", "musescore"]));
183        map.insert("mustache", HashSet::from(["text", "mustache"]));
184        map.insert("myst", HashSet::from(["text", "myst"]));
185        map.insert("ngdoc", HashSet::from(["text", "ngdoc"]));
186        map.insert("nim", HashSet::from(["text", "nim"]));
187        map.insert("nims", HashSet::from(["text", "nim"]));
188        map.insert("nimble", HashSet::from(["text", "nimble"]));
189        map.insert("nix", HashSet::from(["text", "nix"]));
190        map.insert("njk", HashSet::from(["text", "nunjucks"]));
191        map.insert("otf", HashSet::from(["binary", "otf"]));
192        map.insert("p12", HashSet::from(["binary", "p12"]));
193        map.insert("pas", HashSet::from(["text", "pascal"]));
194        map.insert("patch", HashSet::from(["text", "diff"]));
195        map.insert("pdf", HashSet::from(["binary", "pdf"]));
196        map.insert("pem", HashSet::from(["text", "pem"]));
197        map.insert("php", HashSet::from(["text", "php"]));
198        map.insert("php4", HashSet::from(["text", "php"]));
199        map.insert("php5", HashSet::from(["text", "php"]));
200        map.insert("phtml", HashSet::from(["text", "php"]));
201        map.insert("pl", HashSet::from(["text", "perl"]));
202        map.insert("plantuml", HashSet::from(["text", "plantuml"]));
203        map.insert("pm", HashSet::from(["text", "perl"]));
204        map.insert("png", HashSet::from(["binary", "image", "png"]));
205        map.insert("po", HashSet::from(["text", "pofile"]));
206        map.insert("pom", HashSet::from(["pom", "text", "xml"]));
207        map.insert("pp", HashSet::from(["text", "puppet"]));
208        map.insert("prisma", HashSet::from(["text", "prisma"]));
209        map.insert("properties", HashSet::from(["text", "java-properties"]));
210        map.insert("props", HashSet::from(["text", "xml", "msbuild"]));
211        map.insert("proto", HashSet::from(["text", "proto"]));
212        map.insert("ps1", HashSet::from(["text", "powershell"]));
213        map.insert("psd1", HashSet::from(["text", "powershell"]));
214        map.insert("psm1", HashSet::from(["text", "powershell"]));
215        map.insert("pug", HashSet::from(["text", "pug"]));
216        map.insert("puml", HashSet::from(["text", "plantuml"]));
217        map.insert("purs", HashSet::from(["text", "purescript"]));
218        map.insert("pxd", HashSet::from(["text", "cython"]));
219        map.insert("pxi", HashSet::from(["text", "cython"]));
220        map.insert("py", HashSet::from(["text", "python"]));
221        map.insert("pyi", HashSet::from(["text", "pyi"]));
222        map.insert("pyproj", HashSet::from(["text", "xml", "pyproj", "msbuild"]));
223        map.insert("pyt", HashSet::from(["text", "python"]));
224        map.insert("pyx", HashSet::from(["text", "cython"]));
225        map.insert("pyz", HashSet::from(["binary", "pyz"]));
226        map.insert("pyzw", HashSet::from(["binary", "pyz"]));
227        map.insert("qml", HashSet::from(["text", "qml"]));
228        map.insert("r", HashSet::from(["text", "r"]));
229        map.insert("rake", HashSet::from(["text", "ruby"]));
230        map.insert("rb", HashSet::from(["text", "ruby"]));
231        map.insert("resx", HashSet::from(["text", "resx", "xml"]));
232        map.insert("rng", HashSet::from(["text", "xml", "relax-ng"]));
233        map.insert("rs", HashSet::from(["text", "rust"]));
234        map.insert("rst", HashSet::from(["text", "rst"]));
235        map.insert("s", HashSet::from(["text", "asm"]));
236        map.insert("sas", HashSet::from(["text", "sas"]));
237        map.insert("sass", HashSet::from(["text", "sass"]));
238        map.insert("sbt", HashSet::from(["text", "sbt", "scala"]));
239        map.insert("sc", HashSet::from(["text", "scala"]));
240        map.insert("scala", HashSet::from(["text", "scala"]));
241        map.insert("scm", HashSet::from(["text", "scheme"]));
242        map.insert("scss", HashSet::from(["text", "scss"]));
243        map.insert("sh", HashSet::from(["text", "shell"]));
244        map.insert("sln", HashSet::from(["text", "sln"]));
245        map.insert("sls", HashSet::from(["text", "salt"]));
246        map.insert("so", HashSet::from(["binary"]));
247        map.insert("sol", HashSet::from(["text", "solidity"]));
248        map.insert("spec", HashSet::from(["text", "spec"]));
249        map.insert("sql", HashSet::from(["text", "sql"]));
250        map.insert("ss", HashSet::from(["text", "scheme"]));
251        map.insert("sty", HashSet::from(["text", "tex"]));
252        map.insert("styl", HashSet::from(["text", "stylus"]));
253        map.insert("sv", HashSet::from(["text", "system-verilog"]));
254        map.insert("svelte", HashSet::from(["text", "svelte"]));
255        map.insert("svg", HashSet::from(["text", "image", "svg", "xml"]));
256        map.insert("svh", HashSet::from(["text", "system-verilog"]));
257        map.insert("swf", HashSet::from(["binary", "swf"]));
258        map.insert("swift", HashSet::from(["text", "swift"]));
259        map.insert("swiftdeps", HashSet::from(["text", "swiftdeps"]));
260        map.insert("tac", HashSet::from(["text", "twisted", "python"]));
261        map.insert("tar", HashSet::from(["binary", "tar"]));
262        map.insert("targets", HashSet::from(["text", "xml", "msbuild"]));
263        map.insert("templ", HashSet::from(["text", "templ"]));
264        map.insert("tex", HashSet::from(["text", "tex"]));
265        map.insert("textproto", HashSet::from(["text", "textproto"]));
266        map.insert("tf", HashSet::from(["text", "terraform"]));
267        map.insert("tfvars", HashSet::from(["text", "terraform"]));
268        map.insert("tgz", HashSet::from(["binary", "gzip"]));
269        map.insert("thrift", HashSet::from(["text", "thrift"]));
270        map.insert("tiff", HashSet::from(["binary", "image", "tiff"]));
271        map.insert("toml", HashSet::from(["text", "toml"]));
272        map.insert("ts", HashSet::from(["text", "ts"]));
273        map.insert("tsv", HashSet::from(["text", "tsv"]));
274        map.insert("tsx", HashSet::from(["text", "tsx"]));
275        map.insert("ttf", HashSet::from(["binary", "ttf"]));
276        map.insert("twig", HashSet::from(["text", "twig"]));
277        map.insert("txsprofile", HashSet::from(["text", "ini", "txsprofile"]));
278        map.insert("txt", HashSet::from(["text", "plain-text"]));
279        map.insert("txtpb", HashSet::from(["text", "textproto"]));
280        map.insert("urdf", HashSet::from(["text", "xml", "urdf"]));
281        map.insert("v", HashSet::from(["text", "verilog"]));
282        map.insert("vb", HashSet::from(["text", "vb"]));
283        map.insert("vbproj", HashSet::from(["text", "xml", "vbproj", "msbuild"]));
284        map.insert("vcxproj", HashSet::from(["text", "xml", "vcxproj", "msbuild"]));
285        map.insert("vdx", HashSet::from(["text", "vdx"]));
286        map.insert("vh", HashSet::from(["text", "verilog"]));
287        map.insert("vhd", HashSet::from(["text", "vhdl"]));
288        map.insert("vim", HashSet::from(["text", "vim"]));
289        map.insert("vtl", HashSet::from(["text", "vtl"]));
290        map.insert("vue", HashSet::from(["text", "vue"]));
291        map.insert("war", HashSet::from(["binary", "zip", "jar"]));
292        map.insert("wav", HashSet::from(["binary", "audio", "wav"]));
293        map.insert("webp", HashSet::from(["binary", "image", "webp"]));
294        map.insert("whl", HashSet::from(["binary", "wheel", "zip"]));
295        map.insert("wkt", HashSet::from(["text", "wkt"]));
296        map.insert("woff", HashSet::from(["binary", "woff"]));
297        map.insert("woff2", HashSet::from(["binary", "woff2"]));
298        map.insert("wsdl", HashSet::from(["text", "xml", "wsdl"]));
299        map.insert("wsgi", HashSet::from(["text", "wsgi", "python"]));
300        map.insert("xhtml", HashSet::from(["text", "xml", "html", "xhtml"]));
301        map.insert("xacro", HashSet::from(["text", "xml", "urdf", "xacro"]));
302        map.insert("xctestplan", HashSet::from(["text", "json"]));
303        map.insert("xml", HashSet::from(["text", "xml"]));
304        map.insert("xq", HashSet::from(["text", "xquery"]));
305        map.insert("xql", HashSet::from(["text", "xquery"]));
306        map.insert("xqm", HashSet::from(["text", "xquery"]));
307        map.insert("xqu", HashSet::from(["text", "xquery"]));
308        map.insert("xquery", HashSet::from(["text", "xquery"]));
309        map.insert("xqy", HashSet::from(["text", "xquery"]));
310        map.insert("xsd", HashSet::from(["text", "xml", "xsd"]));
311        map.insert("xsl", HashSet::from(["text", "xml", "xsl"]));
312        map.insert("xslt", HashSet::from(["text", "xml", "xsl"]));
313        map.insert("yaml", HashSet::from(["text", "yaml"]));
314        map.insert("yamlld", HashSet::from(["text", "yaml", "yamlld"]));
315        map.insert("yang", HashSet::from(["text", "yang"]));
316        map.insert("yin", HashSet::from(["text", "xml", "yin"]));
317        map.insert("yml", HashSet::from(["text", "yaml"]));
318        map.insert("zcml", HashSet::from(["text", "xml", "zcml"]));
319        map.insert("zig", HashSet::from(["text", "zig"]));
320        map.insert("zip", HashSet::from(["binary", "zip"]));
321        map.insert("zpt", HashSet::from(["text", "zpt"]));
322        map.insert("zsh", HashSet::from(["text", "shell", "zsh"]));
323
324        map
325    };
326
327    pub static ref EXTENSIONS_NEED_BINARY_CHECK: HashMap<&'static str, TagSet> = {
328        let mut map = HashMap::new();
329        map.insert("plist", HashSet::from(["plist"]));
330        map.insert("ppm", HashSet::from(["image", "ppm"]));
331        map
332    };
333
334    pub static ref NAMES: HashMap<&'static str, TagSet> = {
335        let mut map = HashMap::new();
336
337        // Helper function to merge sets
338        let merge = |base: &[&'static str], additional: &[&'static str]| -> TagSet {
339            base.iter().cloned().chain(additional.iter().cloned()).collect()
340        };
341
342        // YAML-based configs
343        map.insert(".ansible-lint", HashSet::from(["text", "yaml"]));
344        map.insert(".clang-format", HashSet::from(["text", "yaml"]));
345        map.insert(".clang-tidy", HashSet::from(["text", "yaml"]));
346        map.insert(".salt-lint", merge(&["text", "yaml"], &["salt-lint"]));
347        map.insert(".yamllint", merge(&["text", "yaml"], &["yamllint"]));
348
349        // JSON-based configs
350        map.insert(".babelrc", merge(&["text", "json"], &["babelrc"]));
351        map.insert(".bowerrc", merge(&["text", "json"], &["bowerrc"]));
352        map.insert(".csslintrc", merge(&["text", "json"], &["csslintrc"]));
353        map.insert(".eslintrc", HashSet::from(["text", "json"]));
354        map.insert(".eslintrc.js", HashSet::from(["text", "javascript"]));
355        map.insert(".eslintrc.json", HashSet::from(["text", "json"]));
356        map.insert(".eslintrc.yaml", HashSet::from(["text", "yaml"]));
357        map.insert(".eslintrc.yml", HashSet::from(["text", "yaml"]));
358        map.insert(".jshintrc", merge(&["text", "json"], &["jshintrc"]));
359        map.insert(".mention-bot", merge(&["text", "json"], &["mention-bot"]));
360        map.insert(".prettierrc", HashSet::from(["text", "json"]));
361        map.insert(".prettierrc.json", HashSet::from(["text", "json"]));
362        map.insert(".prettierrc.toml", HashSet::from(["text", "toml"]));
363        map.insert(".prettierrc.yaml", HashSet::from(["text", "yaml"]));
364        map.insert(".prettierrc.yml", HashSet::from(["text", "yaml"]));
365        map.insert(".stylintrc", HashSet::from(["text", "json"]));
366
367        // Shell configs
368        map.insert(".bash_aliases", HashSet::from(["text", "shell", "bash"]));
369        map.insert(".bash_profile", HashSet::from(["text", "shell", "bash"]));
370        map.insert(".bashrc", HashSet::from(["text", "shell", "bash"]));
371        map.insert(".cshrc", HashSet::from(["text", "shell", "csh"]));
372        map.insert(".envrc", HashSet::from(["text", "shell", "bash"]));
373        map.insert(".zlogin", HashSet::from(["text", "shell", "zsh"]));
374        map.insert(".zlogout", HashSet::from(["text", "shell", "zsh"]));
375        map.insert(".zprofile", HashSet::from(["text", "shell", "zsh"]));
376        map.insert(".zshrc", HashSet::from(["text", "shell", "zsh"]));
377        map.insert(".zshenv", HashSet::from(["text", "shell", "zsh"]));
378        map.insert("direnvrc", HashSet::from(["text", "shell", "bash"]));
379
380        // INI-based configs
381        map.insert(".codespellrc", merge(&["text", "ini"], &["codespellrc"]));
382        map.insert(".coveragerc", merge(&["text", "ini"], &["coveragerc"]));
383        map.insert(".flake8", merge(&["text", "ini"], &["flake8"]));
384        map.insert(".gitconfig", merge(&["text", "ini"], &["gitconfig"]));
385        map.insert(".gitlint", merge(&["text", "ini"], &["gitlint"]));
386        map.insert(".hgrc", merge(&["text", "ini"], &["hgrc"]));
387        map.insert(".isort.cfg", merge(&["text", "ini"], &["isort"]));
388        map.insert(".pypirc", merge(&["text", "ini"], &["pypirc"]));
389        map.insert(".rstcheck.cfg", HashSet::from(["text", "ini"]));
390        map.insert(".sqlfluff", HashSet::from(["text", "ini"]));
391        map.insert("pylintrc", merge(&["text", "ini"], &["pylintrc"]));
392        map.insert("setup.cfg", HashSet::from(["text", "ini"]));
393
394        // Git files
395        map.insert(".dockerignore", HashSet::from(["text", "dockerignore"]));
396        map.insert(".gitattributes", HashSet::from(["text", "gitattributes"]));
397        map.insert(".gitignore", HashSet::from(["text", "gitignore"]));
398        map.insert(".gitmodules", HashSet::from(["text", "gitmodules"]));
399        map.insert(".npmignore", HashSet::from(["text", "npmignore"]));
400        map.insert(".prettierignore", HashSet::from(["text", "gitignore", "prettierignore"]));
401
402        // Special files
403        map.insert(".bazelrc", HashSet::from(["text", "bazelrc"]));
404        map.insert(".browserslistrc", HashSet::from(["text", "browserslistrc"]));
405        map.insert(".editorconfig", HashSet::from(["text", "editorconfig"]));
406        map.insert(".mailmap", HashSet::from(["text", "mailmap"]));
407        map.insert(".pdbrc", merge(&["text", "python"], &["pdbrc"]));
408
409        // Build files
410        map.insert("BUILD", HashSet::from(["text", "bazel"]));
411        map.insert("BUILD.bazel", HashSet::from(["text", "bazel"]));
412        map.insert("CMakeLists.txt", HashSet::from(["text", "cmake"]));
413        map.insert("Dockerfile", HashSet::from(["text", "dockerfile"]));
414        map.insert("Containerfile", HashSet::from(["text", "dockerfile"]));
415        map.insert("Makefile", HashSet::from(["text", "makefile"]));
416        map.insert("GNUmakefile", HashSet::from(["text", "makefile"]));
417        map.insert("makefile", HashSet::from(["text", "makefile"]));
418        map.insert("meson.build", HashSet::from(["text", "meson"]));
419        map.insert("meson_options.txt", HashSet::from(["text", "meson"]));
420        map.insert("WORKSPACE", HashSet::from(["text", "bazel"]));
421        map.insert("WORKSPACE.bazel", HashSet::from(["text", "bazel"]));
422        map.insert("copy.bara.sky", HashSet::from(["text", "bazel"]));
423
424        // Package files
425        map.insert("Cargo.toml", merge(&["text", "toml"], &["cargo"]));
426        map.insert("Cargo.lock", merge(&["text", "toml"], &["cargo-lock"]));
427        map.insert("composer.json", HashSet::from(["text", "json"]));
428        map.insert("composer.lock", HashSet::from(["text", "json"]));
429        map.insert("go.mod", HashSet::from(["text", "go-mod"]));
430        map.insert("go.sum", HashSet::from(["text", "go-sum"]));
431        map.insert("package.json", HashSet::from(["text", "json"]));
432        map.insert("package-lock.json", HashSet::from(["text", "json"]));
433        map.insert("Pipfile", HashSet::from(["text", "toml"]));
434        map.insert("Pipfile.lock", HashSet::from(["text", "json"]));
435        map.insert("poetry.lock", HashSet::from(["text", "toml"]));
436        map.insert("pom.xml", HashSet::from(["pom", "text", "xml"]));
437        map.insert("yarn.lock", HashSet::from(["text", "yaml"]));
438
439        // Ruby files
440        map.insert("config.ru", HashSet::from(["text", "ruby"]));
441        map.insert("Gemfile", HashSet::from(["text", "ruby"]));
442        map.insert("Gemfile.lock", HashSet::from(["text"]));
443        map.insert("Rakefile", HashSet::from(["text", "ruby"]));
444        map.insert("Vagrantfile", HashSet::from(["text", "ruby"]));
445
446        // Bitbake files
447        map.insert("bblayers.conf", HashSet::from(["text", "bitbake"]));
448        map.insert("bitbake.conf", HashSet::from(["text", "bitbake"]));
449
450        // Erlang files
451        map.insert("rebar.config", HashSet::from(["text", "erlang"]));
452        map.insert("sys.config", HashSet::from(["text", "erlang"]));
453        map.insert("sys.config.src", HashSet::from(["text", "erlang"]));
454
455        // Documentation and misc
456        map.insert("AUTHORS", HashSet::from(["text", "plain-text"]));
457        map.insert("CHANGELOG", HashSet::from(["text", "plain-text"]));
458        map.insert("CONTRIBUTING", HashSet::from(["text", "plain-text"]));
459        map.insert("COPYING", HashSet::from(["text", "plain-text"]));
460        map.insert("LICENSE", HashSet::from(["text", "plain-text"]));
461        map.insert("MAINTAINERS", HashSet::from(["text", "plain-text"]));
462        map.insert("NEWS", HashSet::from(["text", "plain-text"]));
463        map.insert("NOTICE", HashSet::from(["text", "plain-text"]));
464        map.insert("PATENTS", HashSet::from(["text", "plain-text"]));
465        map.insert("README", HashSet::from(["text", "plain-text"]));
466
467        // Special build/config files
468        map.insert("Jenkinsfile", HashSet::from(["text", "groovy", "jenkins"]));
469        map.insert("PKGBUILD", HashSet::from(["text", "bash", "pkgbuild", "alpm"]));
470        map.insert("Tiltfile", HashSet::from(["text", "tiltfile"]));
471        map.insert("wscript", HashSet::from(["text", "python"]));
472
473        map
474    };
475}