filetypes.go (sift-0.8.0) | : | filetypes.go (sift-0.9.0) | ||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
package main | package main | |||
import ( | import ( | |||
"regexp" | "regexp" | |||
) | ) | |||
func init() { | func init() { | |||
global.fileTypesMap = map[string]FileType{ | global.fileTypesMap = map[string]FileType{ | |||
"go": FileType{ | "go": FileType{ | |||
Name: "go", | ||||
Patterns: []string{"*.go"}, | Patterns: []string{"*.go"}, | |||
}, | }, | |||
"cc": FileType{ | "cc": FileType{ | |||
Name: "cc", | ||||
Patterns: []string{"*.c", "*.h", "*.xs"}, | Patterns: []string{"*.c", "*.h", "*.xs"}, | |||
}, | }, | |||
"cpp": FileType{ | "cpp": FileType{ | |||
Name: "cpp", | ||||
Patterns: []string{"*.cpp", "*.cc", "*.cxx", "*.m", "*.hp p", "*.hh", "*.h", "*.hxx"}, | Patterns: []string{"*.cpp", "*.cc", "*.cxx", "*.m", "*.hp p", "*.hh", "*.h", "*.hxx"}, | |||
}, | }, | |||
"html": FileType{ | "html": FileType{ | |||
Name: "html", | ||||
Patterns: []string{"*.htm", "*.html", "*.shtml", "*.xhtml "}, | Patterns: []string{"*.htm", "*.html", "*.shtml", "*.xhtml "}, | |||
}, | }, | |||
"groovy": FileType{ | "groovy": FileType{ | |||
Name: "groovy", | ||||
Patterns: []string{"*.groovy", "*.gtmpl", "*.gpp", "*.gru nit", "*.gradle"}, | Patterns: []string{"*.groovy", "*.gtmpl", "*.gpp", "*.gru nit", "*.gradle"}, | |||
}, | }, | |||
"java": FileType{ | "java": FileType{ | |||
Name: "java", | ||||
Patterns: []string{"*.java", "*.properties"}, | Patterns: []string{"*.java", "*.properties"}, | |||
}, | }, | |||
"jsp": FileType{ | "jsp": FileType{ | |||
Name: "jsp", | ||||
Patterns: []string{"*.jsp", "*.jspx", "*.jhtm", "*.jhtml" }, | Patterns: []string{"*.jsp", "*.jspx", "*.jhtm", "*.jhtml" }, | |||
}, | }, | |||
"perl": FileType{ | "perl": FileType{ | |||
Name: "perl", | ||||
Patterns: []string{"*.pl", "*.pm", "*.pod", "*.t"}, | Patterns: []string{"*.pl", "*.pm", "*.pod", "*.t"}, | |||
ShebangRegex: regexp.MustCompile(`^#!.*\bperl\b`), | ShebangRegex: regexp.MustCompile(`^#!.*\bperl\b`), | |||
}, | }, | |||
"php": FileType{ | "php": FileType{ | |||
Name: "php", | ||||
Patterns: []string{"*.php", "*.phpt", "*.php3", "*.ph p4", "*.php5", "*.phtml"}, | Patterns: []string{"*.php", "*.phpt", "*.php3", "*.ph p4", "*.php5", "*.phtml"}, | |||
ShebangRegex: regexp.MustCompile(`^#!.*\bphp\b`), | ShebangRegex: regexp.MustCompile(`^#!.*\bphp\b`), | |||
}, | }, | |||
"ruby": FileType{ | "ruby": FileType{ | |||
Name: "ruby", | ||||
Patterns: []string{"*.rb", "*.rhtml", "*.rjs", "*.rxm l", "*.erb", "*.rake", "*.spec", "Rakefile"}, | Patterns: []string{"*.rb", "*.rhtml", "*.rjs", "*.rxm l", "*.erb", "*.rake", "*.spec", "Rakefile"}, | |||
ShebangRegex: regexp.MustCompile(`^#!.*\bruby\b`), | ShebangRegex: regexp.MustCompile(`^#!.*\bruby\b`), | |||
}, | }, | |||
"python": FileType{ | "python": FileType{ | |||
Name: "python", | ||||
Patterns: []string{"*.py", "*.pyw", "*.pyx", "SConstr uct"}, | Patterns: []string{"*.py", "*.pyw", "*.pyx", "SConstr uct"}, | |||
ShebangRegex: regexp.MustCompile(`^#!.*\bpython[0-9.]*\b` ), | ShebangRegex: regexp.MustCompile(`^#!.*\bpython[0-9.]*\b` ), | |||
}, | }, | |||
"shell": FileType{ | "shell": FileType{ | |||
Name: "shell", | ||||
Patterns: []string{"*.sh", "*.bash", "*.csh", "*.tcsh ", "*.ksh", "*.zsh"}, | Patterns: []string{"*.sh", "*.bash", "*.csh", "*.tcsh ", "*.ksh", "*.zsh"}, | |||
ShebangRegex: regexp.MustCompile(`^#!.*\b(?:ba|t?c|k|z)?s h\b`), | ShebangRegex: regexp.MustCompile(`^#!.*\b(?:ba|t?c|k|z)?s h\b`), | |||
}, | }, | |||
"xml": FileType{ | "xml": FileType{ | |||
Name: "xml", | ||||
Patterns: []string{"*.xml", "*.dtd", "*.xsl", "*.xslt ", "*.ent"}, | Patterns: []string{"*.xml", "*.dtd", "*.xsl", "*.xslt ", "*.ent"}, | |||
ShebangRegex: regexp.MustCompile(`<\?xml`), | ShebangRegex: regexp.MustCompile(`<\?xml`), | |||
}, | }, | |||
} | } | |||
} | } | |||
End of changes. 13 change blocks. | ||||
13 lines changed or deleted | 0 lines changed or added |