Type improvements (config, license, sh, systemd, &c.)

- Add `license` type for various copyright/licence files
- Add `systemd` type for systemd config/unit files
- Update existing `config`, `jinja`, `json`, `sh`, `sql`, `xml`, `yaml` types
- Minor formatting improvements
This commit is contained in:
dana
2017-09-08 15:44:57 -05:00
committed by Andrew Gallant
parent aebb132a86
commit 353806b87a

View File

@@ -110,7 +110,7 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
("cmake", &["*.cmake", "CMakeLists.txt"]), ("cmake", &["*.cmake", "CMakeLists.txt"]),
("coffeescript", &["*.coffee"]), ("coffeescript", &["*.coffee"]),
("creole", &["*.creole"]), ("creole", &["*.creole"]),
("config", &["*.config"]), ("config", &["*.cfg", "*.conf", "*.config", "*.ini"]),
("cpp", &[ ("cpp", &[
"*.C", "*.cc", "*.cpp", "*.cxx", "*.C", "*.cc", "*.cpp", "*.cxx",
"*.h", "*.H", "*.hh", "*.hpp", "*.inl", "*.h", "*.H", "*.hh", "*.hpp", "*.inl",
@@ -141,27 +141,60 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
("haskell", &["*.hs", "*.lhs"]), ("haskell", &["*.hs", "*.lhs"]),
("html", &["*.htm", "*.html", "*.ejs"]), ("html", &["*.htm", "*.html", "*.ejs"]),
("java", &["*.java"]), ("java", &["*.java"]),
("jinja", &["*.jinja", "*.jinja2"]), ("jinja", &["*.j2", "*.jinja", "*.jinja2"]),
("js", &[ ("js", &[
"*.js", "*.jsx", "*.vue", "*.js", "*.jsx", "*.vue",
]), ]),
("json", &["*.json"]), ("json", &["*.json", "composer.lock"]),
("jsonl", &["*.jsonl"]), ("jsonl", &["*.jsonl"]),
("julia", &["*.jl"]), ("julia", &["*.jl"]),
("jl", &["*.jl"]), ("jl", &["*.jl"]),
("kotlin", &["*.kt", "*.kts"]), ("kotlin", &["*.kt", "*.kts"]),
("less", &["*.less"]), ("less", &["*.less"]),
("license", &[
// General
"COPYING", "COPYING[.-]*",
"COPYRIGHT", "COPYRIGHT[.-]*",
"EULA", "EULA[.-]*",
"licen[cs]e", "licen[cs]e.*",
"LICEN[CS]E", "LICEN[CS]E[.-]*", "*[.-]LICEN[CS]E*",
"NOTICE", "NOTICE[.-]*",
"PATENTS", "PATENTS[.-]*",
"UNLICEN[CS]E", "UNLICEN[CS]E[.-]*",
// GPL (gpl.txt, etc.)
"agpl[.-]*",
"gpl[.-]*",
"lgpl[.-]*",
// Other license-specific (APACHE-2.0.txt, etc.)
"AGPL-*[0-9]*",
"APACHE-*[0-9]*",
"BSD-*[0-9]*",
"CC-BY-*",
"GFDL-*[0-9]*",
"GNU-*[0-9]*",
"GPL-*[0-9]*",
"LGPL-*[0-9]*",
"MIT-*[0-9]*",
"MPL-*[0-9]*",
"OFL-*[0-9]*",
]),
("lisp", &["*.el", "*.jl", "*.lisp", "*.lsp", "*.sc", "*.scm"]), ("lisp", &["*.el", "*.jl", "*.lisp", "*.lsp", "*.sc", "*.scm"]),
("log", &["*.log"]), ("log", &["*.log"]),
("lua", &["*.lua"]), ("lua", &["*.lua"]),
("m4", &["*.ac", "*.m4"]), ("m4", &["*.ac", "*.m4"]),
("make", &["gnumakefile", "Gnumakefile", "GNUmakefile", "makefile", "Makefile", "*.mk", "*.mak"]), ("make", &[
"gnumakefile", "Gnumakefile", "GNUmakefile",
"makefile", "Makefile",
"*.mk", "*.mak"
]),
("markdown", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]), ("markdown", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]),
("md", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]), ("md", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]),
("matlab", &["*.m"]), ("matlab", &["*.m"]),
("mk", &["mkfile"]), ("mk", &["mkfile"]),
("ml", &["*.ml"]), ("ml", &["*.ml"]),
("msbuild", &["*.csproj", "*.fsproj", "*.vcxproj", "*.proj", "*.props", "*.targets"]), ("msbuild", &[
"*.csproj", "*.fsproj", "*.vcxproj", "*.proj", "*.props", "*.targets"
]),
("nim", &["*.nim"]), ("nim", &["*.nim"]),
("nix", &["*.nix"]), ("nix", &["*.nix"]),
("objc", &["*.h", "*.m"]), ("objc", &["*.h", "*.m"]),
@@ -183,15 +216,42 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
("rust", &["*.rs"]), ("rust", &["*.rs"]),
("sass", &["*.sass", "*.scss"]), ("sass", &["*.sass", "*.scss"]),
("scala", &["*.scala"]), ("scala", &["*.scala"]),
("sh", &["*.bash", "*.csh", "*.ksh", "*.sh", "*.tcsh"]), ("sh", &[
// Portable/misc. init files
".login", ".logout", ".profile", "profile",
// bash-specific init files
".bash_login", "bash_login",
".bash_logout", "bash_logout",
".bash_profile", "bash_profile",
".bashrc", "bashrc", "*.bashrc",
// csh-specific init files
".cshrc", "*.cshrc",
// ksh-specific init files
".kshrc", "*.kshrc",
// tcsh-specific init files
".tcshrc",
// zsh-specific init files
".zshenv", "zshenv",
".zlogin", "zlogin",
".zlogout", "zlogout",
".zprofile", "zprofile",
".zshrc", "zshrc",
// Extensions
"*.bash", "*.csh", "*.ksh", "*.sh", "*.tcsh", "*.zsh",
]),
("sml", &["*.sml", "*.sig"]), ("sml", &["*.sml", "*.sig"]),
("spark", &["*.spark"]), ("spark", &["*.spark"]),
("sql", &["*.sql", "*.psql"]),
("stylus", &["*.styl"]), ("stylus", &["*.styl"]),
("sql", &["*.sql"]),
("sv", &["*.v", "*.vg", "*.sv", "*.svh", "*.h"]), ("sv", &["*.v", "*.vg", "*.sv", "*.svh", "*.h"]),
("svg", &["*.svg"]), ("svg", &["*.svg"]),
("swift", &["*.swift"]), ("swift", &["*.swift"]),
("swig", &["*.def", "*.i"]), ("swig", &["*.def", "*.i"]),
("systemd", &[
"*.automount", "*.conf", "*.device", "*.link", "*.mount", "*.path",
"*.scope", "*.service", "*.slice", "*.socket", "*.swap", "*.target",
"*.timer",
]),
("taskpaper", &["*.taskpaper"]), ("taskpaper", &["*.taskpaper"]),
("tcl", &["*.tcl"]), ("tcl", &["*.tcl"]),
("tex", &["*.tex", "*.ltx", "*.cls", "*.sty", "*.bib"]), ("tex", &["*.tex", "*.ltx", "*.cls", "*.sty", "*.bib"]),
@@ -206,10 +266,17 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
("vim", &["*.vim"]), ("vim", &["*.vim"]),
("vimscript", &["*.vim"]), ("vimscript", &["*.vim"]),
("wiki", &["*.mediawiki", "*.wiki"]), ("wiki", &["*.mediawiki", "*.wiki"]),
("xml", &["*.xml"]), ("xml", &["*.xml", "*.xml.dist"]),
("yacc", &["*.y"]), ("yacc", &["*.y"]),
("yaml", &["*.yaml", "*.yml"]), ("yaml", &["*.yaml", "*.yml", "yarn.lock"]),
("zsh", &["zshenv", ".zshenv", "zprofile", ".zprofile", "zshrc", ".zshrc", "zlogin", ".zlogin", "zlogout", ".zlogout", "*.zsh"]), ("zsh", &[
".zshenv", "zshenv",
".zlogin", "zlogin",
".zlogout", "zlogout",
".zprofile", "zprofile",
".zshrc", "zshrc",
"*.zsh",
]),
]; ];
/// Glob represents a single glob in a set of file type definitions. /// Glob represents a single glob in a set of file type definitions.