summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordana <dana@dana.is>2017-09-08 15:44:57 -0500
committerAndrew Gallant <jamslam@gmail.com>2017-10-08 08:05:28 -0400
commit353806b87ae1807af22145347b5b7b945da6315a (patch)
tree493d8a8b976cc6f98edd15126bffa5941b0c41f5
parentaebb132a8629a28a7315a7d8b5f4a39196b6fac4 (diff)
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
-rw-r--r--ignore/src/types.rs87
1 files changed, 77 insertions, 10 deletions
diff --git a/ignore/src/types.rs b/ignore/src/types.rs
index 1312bb8a..775e0c53 100644
--- a/ignore/src/types.rs
+++ b/ignore/src/types.rs
@@ -110,7 +110,7 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
("cmake", &["*.cmake", "CMakeLists.txt"]),
("coffeescript", &["*.coffee"]),
("creole", &["*.creole"]),
- ("config", &["*.config"]),
+ ("config", &["*.cfg", "*.conf", "*.config", "*.ini"]),
("cpp", &[
"*.C", "*.cc", "*.cpp", "*.cxx",
"*.h", "*.H", "*.hh", "*.hpp", "*.inl",
@@ -141,27 +141,60 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
("haskell", &["*.hs", "*.lhs"]),
("html", &["*.htm", "*.html", "*.ejs"]),
("java", &["*.java"]),
- ("jinja", &["*.jinja", "*.jinja2"]),
+ ("jinja", &["*.j2", "*.jinja", "*.jinja2"]),
("js", &[
"*.js", "*.jsx", "*.vue",
]),
- ("json", &["*.json"]),
+ ("json", &["*.json", "composer.lock"]),
("jsonl", &["*.jsonl"]),
("julia", &["*.jl"]),
("jl", &["*.jl"]),
("kotlin", &["*.kt", "*.kts"]),
("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"]),
("log", &["*.log"]),
("lua", &["*.lua"]),
("m4", &["*.ac", "*.m4"]),
- ("make", &["gnumakefile", "Gnumakefile", "GNUmakefile", "makefile", "Makefile", "*.mk", "*.mak"]),
+ ("make", &[
+ "gnumakefile", "Gnumakefile", "GNUmakefile",
+ "makefile", "Makefile",
+ "*.mk", "*.mak"
+ ]),
("markdown", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]),
("md", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]),
("matlab", &["*.m"]),
("mk", &["mkfile"]),
("ml", &["*.ml"]),
- ("msbuild", &["*.csproj", "*.fsproj", "*.vcxproj", "*.proj", "*.props", "*.targets"]),
+ ("msbuild", &[
+ "*.csproj", "*.fsproj", "*.vcxproj", "*.proj", "*.props", "*.targets"
+ ]),
("nim", &["*.nim"]),
("nix", &["*.nix"]),
("objc", &["*.h", "*.m"]),
@@ -183,15 +216,42 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
("rust", &["*.rs"]),
("sass", &["*.sass", "*.scss"]),
("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"]),
("spark", &["*.spark"]),
+ ("sql", &["*.sql", "*.psql"]),
("stylus", &["*.styl"]),
- ("sql", &["*.sql"]),
("sv", &["*.v", "*.vg", "*.sv", "*.svh", "*.h"]),
("svg", &["*.svg"]),
("swift", &["*.swift"]),
("swig", &["*.def", "*.i"]),
+ ("systemd", &[
+ "*.automount", "*.conf", "*.device", "*.link", "*.mount", "*.path",
+ "*.scope", "*.service", "*.slice", "*.socket", "*.swap", "*.target",
+ "*.timer",
+ ]),
("taskpaper", &["*.taskpaper"]),
("tcl", &["*.tcl"]),
("tex", &["*.tex", "*.ltx", "*.cls", "*.sty", "*.bib"]),
@@ -206,10 +266,17 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
("vim", &["*.vim"]),
("vimscript", &["*.vim"]),
("wiki", &["*.mediawiki", "*.wiki"]),
- ("xml", &["*.xml"]),
+ ("xml", &["*.xml", "*.xml.dist"]),
("yacc", &["*.y"]),
- ("yaml", &["*.yaml", "*.yml"]),
- ("zsh", &["zshenv", ".zshenv", "zprofile", ".zprofile", "zshrc", ".zshrc", "zlogin", ".zlogin", "zlogout", ".zlogout", "*.zsh"]),
+ ("yaml", &["*.yaml", "*.yml", "yarn.lock"]),
+ ("zsh", &[
+ ".zshenv", "zshenv",
+ ".zlogin", "zlogin",
+ ".zlogout", "zlogout",
+ ".zprofile", "zprofile",
+ ".zshrc", "zshrc",
+ "*.zsh",
+ ]),
];
/// Glob represents a single glob in a set of file type definitions.