mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 08:30:07 -03:00
changed langs.go to unmarshal on a languageInfo struct
This commit is contained in:
parent
fee9949d1d
commit
5d61ca93d8
@ -2,7 +2,6 @@ package generator
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
"text/template"
|
"text/template"
|
||||||
@ -10,19 +9,22 @@ import (
|
|||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
type languageInfo struct {
|
||||||
// ErrExtensionsNotFound is the error returned if data parsed doesn't contain extensions.
|
Type string `yaml:"type,omitempty" json:"type,omitempty"`
|
||||||
ErrExtensionsNotFound = errors.New("extensions not found")
|
Aliases []string `yaml:"aliases,omitempty,flow" json:"aliases,omitempty"`
|
||||||
)
|
Extensions []string `yaml:"extensions,omitempty,flow" json:"extensions,omitempty"`
|
||||||
|
Interpreters []string `yaml:"interpreters,omitempty,flow" json:"interpreters,omitempty"`
|
||||||
|
Group string `yaml:"group,omitempty" json:"group,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Languages reads from buf and builds languages.go file from languagesTmplPath.
|
// Languages reads from buf and builds languages.go file from languagesTmplPath.
|
||||||
func Languages(data []byte, languagesTmplPath, languagesTmplName, commit string) ([]byte, error) {
|
func Languages(data []byte, languagesTmplPath, languagesTmplName, commit string) ([]byte, error) {
|
||||||
var yamlSlice yaml.MapSlice
|
languages := make(map[string]*languageInfo)
|
||||||
if err := yaml.Unmarshal(data, &yamlSlice); err != nil {
|
if err := yaml.Unmarshal(data, &languages); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
languagesByExtension, err := buildExtensionLanguageMap(yamlSlice)
|
languagesByExtension, err := buildExtensionLanguageMap(languages)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -35,48 +37,17 @@ func Languages(data []byte, languagesTmplPath, languagesTmplName, commit string)
|
|||||||
return buf.Bytes(), nil
|
return buf.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildExtensionLanguageMap(yamlSlice yaml.MapSlice) (map[string][]string, error) {
|
func buildExtensionLanguageMap(languages map[string]*languageInfo) (map[string][]string, error) {
|
||||||
extensionLangsMap := make(map[string][]string)
|
extensionLangsMap := make(map[string][]string)
|
||||||
for _, lang := range yamlSlice {
|
for lang, info := range languages {
|
||||||
extensions, err := findExtensions(lang.Value.(yaml.MapSlice))
|
for _, extension := range info.Extensions {
|
||||||
if err != nil && err != ErrExtensionsNotFound {
|
extensionLangsMap[extension] = append(extensionLangsMap[extension], lang)
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fillMap(extensionLangsMap, lang.Key.(string), extensions)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return extensionLangsMap, nil
|
return extensionLangsMap, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func findExtensions(items yaml.MapSlice) ([]string, error) {
|
|
||||||
const extField = "extensions"
|
|
||||||
for _, item := range items {
|
|
||||||
if item.Key == extField {
|
|
||||||
extensions := toStringSlice(item.Value.([]interface{}))
|
|
||||||
return extensions, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, ErrExtensionsNotFound
|
|
||||||
}
|
|
||||||
|
|
||||||
func toStringSlice(slice []interface{}) []string {
|
|
||||||
extensions := make([]string, 0, len(slice))
|
|
||||||
for _, element := range slice {
|
|
||||||
extension := element.(string)
|
|
||||||
extensions = append(extensions, extension)
|
|
||||||
}
|
|
||||||
|
|
||||||
return extensions
|
|
||||||
}
|
|
||||||
|
|
||||||
func fillMap(extensionLangs map[string][]string, lang string, extensions []string) {
|
|
||||||
for _, extension := range extensions {
|
|
||||||
extensionLangs[extension] = append(extensionLangs[extension], lang)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func executeLanguagesTemplate(out io.Writer, languagesByExtension map[string][]string, languagesTmplPath, languagesTmpl, commit string) error {
|
func executeLanguagesTemplate(out io.Writer, languagesByExtension map[string][]string, languagesTmplPath, languagesTmpl, commit string) error {
|
||||||
fmap := template.FuncMap{
|
fmap := template.FuncMap{
|
||||||
"getCommit": func() string { return commit },
|
"getCommit": func() string { return commit },
|
||||||
|
96
languages.go
96
languages.go
@ -62,7 +62,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".arpa": {"DNS Zone"},
|
".arpa": {"DNS Zone"},
|
||||||
".as": {"ActionScript"},
|
".as": {"ActionScript"},
|
||||||
".asax": {"ASP"},
|
".asax": {"ASP"},
|
||||||
".asc": {"AGS Script", "AsciiDoc", "Public Key"},
|
".asc": {"AsciiDoc", "AGS Script", "Public Key"},
|
||||||
".asciidoc": {"AsciiDoc"},
|
".asciidoc": {"AsciiDoc"},
|
||||||
".ascx": {"ASP"},
|
".ascx": {"ASP"},
|
||||||
".asd": {"Common Lisp"},
|
".asd": {"Common Lisp"},
|
||||||
@ -87,15 +87,15 @@ var languagesByExtension = map[string][]string{
|
|||||||
".axml": {"XML"},
|
".axml": {"XML"},
|
||||||
".axs": {"NetLinx"},
|
".axs": {"NetLinx"},
|
||||||
".axs.erb": {"NetLinx+ERB"},
|
".axs.erb": {"NetLinx+ERB"},
|
||||||
".b": {"Brainfuck", "Limbo"},
|
".b": {"Limbo", "Brainfuck"},
|
||||||
".bas": {"Visual Basic"},
|
".bas": {"Visual Basic"},
|
||||||
".bash": {"Shell"},
|
".bash": {"Shell"},
|
||||||
".bat": {"Batchfile"},
|
".bat": {"Batchfile"},
|
||||||
".bats": {"Shell"},
|
".bats": {"Shell"},
|
||||||
".bb": {"BitBake", "BlitzBasic"},
|
".bb": {"BlitzBasic", "BitBake"},
|
||||||
".bbx": {"TeX"},
|
".bbx": {"TeX"},
|
||||||
".befunge": {"Befunge"},
|
".befunge": {"Befunge"},
|
||||||
".bf": {"Brainfuck", "HyPhy"},
|
".bf": {"HyPhy", "Brainfuck"},
|
||||||
".bib": {"TeX"},
|
".bib": {"TeX"},
|
||||||
".bison": {"Bison"},
|
".bison": {"Bison"},
|
||||||
".blade": {"Blade"},
|
".blade": {"Blade"},
|
||||||
@ -104,7 +104,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".bones": {"JavaScript"},
|
".bones": {"JavaScript"},
|
||||||
".boo": {"Boo"},
|
".boo": {"Boo"},
|
||||||
".boot": {"Clojure"},
|
".boot": {"Clojure"},
|
||||||
".brd": {"Eagle", "KiCad"},
|
".brd": {"KiCad", "Eagle"},
|
||||||
".bro": {"Bro"},
|
".bro": {"Bro"},
|
||||||
".brs": {"Brightscript"},
|
".brs": {"Brightscript"},
|
||||||
".bsl": {"1C Enterprise"},
|
".bsl": {"1C Enterprise"},
|
||||||
@ -117,7 +117,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".c++-objdump": {"Cpp-ObjDump"},
|
".c++-objdump": {"Cpp-ObjDump"},
|
||||||
".c++objdump": {"Cpp-ObjDump"},
|
".c++objdump": {"Cpp-ObjDump"},
|
||||||
".c-objdump": {"C-ObjDump"},
|
".c-objdump": {"C-ObjDump"},
|
||||||
".cake": {"C#", "CoffeeScript"},
|
".cake": {"CoffeeScript", "C#"},
|
||||||
".capnp": {"Cap'n Proto"},
|
".capnp": {"Cap'n Proto"},
|
||||||
".cats": {"C"},
|
".cats": {"C"},
|
||||||
".cbl": {"COBOL"},
|
".cbl": {"COBOL"},
|
||||||
@ -131,7 +131,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".cfg": {"INI"},
|
".cfg": {"INI"},
|
||||||
".cfm": {"ColdFusion"},
|
".cfm": {"ColdFusion"},
|
||||||
".cfml": {"ColdFusion"},
|
".cfml": {"ColdFusion"},
|
||||||
".cgi": {"Perl", "Python", "Shell"},
|
".cgi": {"Shell", "Python", "Perl"},
|
||||||
".ch": {"Charity", "xBase"},
|
".ch": {"Charity", "xBase"},
|
||||||
".chem": {"Pic"},
|
".chem": {"Pic"},
|
||||||
".chpl": {"Chapel"},
|
".chpl": {"Chapel"},
|
||||||
@ -139,7 +139,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".cirru": {"Cirru"},
|
".cirru": {"Cirru"},
|
||||||
".cjsx": {"CoffeeScript"},
|
".cjsx": {"CoffeeScript"},
|
||||||
".ck": {"ChucK"},
|
".ck": {"ChucK"},
|
||||||
".cl": {"Common Lisp", "Cool", "OpenCL"},
|
".cl": {"OpenCL", "Common Lisp", "Cool"},
|
||||||
".cl2": {"Clojure"},
|
".cl2": {"Clojure"},
|
||||||
".click": {"Click"},
|
".click": {"Click"},
|
||||||
".clixml": {"XML"},
|
".clixml": {"XML"},
|
||||||
@ -150,7 +150,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".cljscm": {"Clojure"},
|
".cljscm": {"Clojure"},
|
||||||
".cljx": {"Clojure"},
|
".cljx": {"Clojure"},
|
||||||
".clp": {"CLIPS"},
|
".clp": {"CLIPS"},
|
||||||
".cls": {"Apex", "OpenEdge ABL", "TeX", "Visual Basic"},
|
".cls": {"TeX", "Apex", "OpenEdge ABL", "Visual Basic"},
|
||||||
".clw": {"Clarion"},
|
".clw": {"Clarion"},
|
||||||
".cmake": {"CMake"},
|
".cmake": {"CMake"},
|
||||||
".cmake.in": {"CMake"},
|
".cmake.in": {"CMake"},
|
||||||
@ -189,7 +189,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".cxx": {"C++"},
|
".cxx": {"C++"},
|
||||||
".cxx-objdump": {"Cpp-ObjDump"},
|
".cxx-objdump": {"Cpp-ObjDump"},
|
||||||
".cy": {"Cycript"},
|
".cy": {"Cycript"},
|
||||||
".d": {"D", "DTrace", "Makefile"},
|
".d": {"Makefile", "DTrace", "D"},
|
||||||
".d-objdump": {"D-ObjDump"},
|
".d-objdump": {"D-ObjDump"},
|
||||||
".dae": {"COLLADA"},
|
".dae": {"COLLADA"},
|
||||||
".darcspatch": {"Darcs Patch"},
|
".darcspatch": {"Darcs Patch"},
|
||||||
@ -229,7 +229,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".ebnf": {"EBNF"},
|
".ebnf": {"EBNF"},
|
||||||
".ebuild": {"Gentoo Ebuild"},
|
".ebuild": {"Gentoo Ebuild"},
|
||||||
".ec": {"eC"},
|
".ec": {"eC"},
|
||||||
".ecl": {"ECL", "ECLiPSe"},
|
".ecl": {"ECLiPSe", "ECL"},
|
||||||
".eclass": {"Gentoo Eclass"},
|
".eclass": {"Gentoo Eclass"},
|
||||||
".eclxml": {"ECL"},
|
".eclxml": {"ECL"},
|
||||||
".ecr": {"HTML+ECR"},
|
".ecr": {"HTML+ECR"},
|
||||||
@ -257,7 +257,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".ex": {"Elixir"},
|
".ex": {"Elixir"},
|
||||||
".exs": {"Elixir"},
|
".exs": {"Elixir"},
|
||||||
".eye": {"Ruby"},
|
".eye": {"Ruby"},
|
||||||
".f": {"Filebench WML", "Forth", "Fortran"},
|
".f": {"Fortran", "Filebench WML", "Forth"},
|
||||||
".f03": {"Fortran"},
|
".f03": {"Fortran"},
|
||||||
".f08": {"Fortran"},
|
".f08": {"Fortran"},
|
||||||
".f77": {"Fortran"},
|
".f77": {"Fortran"},
|
||||||
@ -266,24 +266,24 @@ var languagesByExtension = map[string][]string{
|
|||||||
".factor": {"Factor"},
|
".factor": {"Factor"},
|
||||||
".fan": {"Fantom"},
|
".fan": {"Fantom"},
|
||||||
".fancypack": {"Fancy"},
|
".fancypack": {"Fancy"},
|
||||||
".fcgi": {"Lua", "PHP", "Perl", "Python", "Ruby", "Shell"},
|
".fcgi": {"Lua", "Shell", "PHP", "Python", "Perl", "Ruby"},
|
||||||
".fea": {"OpenType Feature File"},
|
".fea": {"OpenType Feature File"},
|
||||||
".feature": {"Gherkin"},
|
".feature": {"Gherkin"},
|
||||||
".filters": {"XML"},
|
".filters": {"XML"},
|
||||||
".fish": {"fish"},
|
".fish": {"fish"},
|
||||||
".flex": {"JFlex"},
|
".flex": {"JFlex"},
|
||||||
".flux": {"FLUX"},
|
".flux": {"FLUX"},
|
||||||
".for": {"Formatted", "Forth", "Fortran"},
|
".for": {"Formatted", "Fortran", "Forth"},
|
||||||
".forth": {"Forth"},
|
".forth": {"Forth"},
|
||||||
".fp": {"GLSL"},
|
".fp": {"GLSL"},
|
||||||
".fpp": {"Fortran"},
|
".fpp": {"Fortran"},
|
||||||
".fr": {"Forth", "Frege", "Text"},
|
".fr": {"Text", "Frege", "Forth"},
|
||||||
".frag": {"GLSL", "JavaScript"},
|
".frag": {"JavaScript", "GLSL"},
|
||||||
".frg": {"GLSL"},
|
".frg": {"GLSL"},
|
||||||
".frm": {"Visual Basic"},
|
".frm": {"Visual Basic"},
|
||||||
".frt": {"Forth"},
|
".frt": {"Forth"},
|
||||||
".frx": {"Visual Basic"},
|
".frx": {"Visual Basic"},
|
||||||
".fs": {"F#", "Filterscript", "Forth", "GLSL"},
|
".fs": {"Filterscript", "GLSL", "F#", "Forth"},
|
||||||
".fsh": {"GLSL"},
|
".fsh": {"GLSL"},
|
||||||
".fshader": {"GLSL"},
|
".fshader": {"GLSL"},
|
||||||
".fsi": {"F#"},
|
".fsi": {"F#"},
|
||||||
@ -292,7 +292,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".fth": {"Forth"},
|
".fth": {"Forth"},
|
||||||
".ftl": {"FreeMarker"},
|
".ftl": {"FreeMarker"},
|
||||||
".fun": {"Standard ML"},
|
".fun": {"Standard ML"},
|
||||||
".fx": {"FLUX", "HLSL"},
|
".fx": {"HLSL", "FLUX"},
|
||||||
".fxh": {"HLSL"},
|
".fxh": {"HLSL"},
|
||||||
".fxml": {"XML"},
|
".fxml": {"XML"},
|
||||||
".fy": {"Fancy"},
|
".fy": {"Fancy"},
|
||||||
@ -302,7 +302,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".gawk": {"Awk"},
|
".gawk": {"Awk"},
|
||||||
".gco": {"G-code"},
|
".gco": {"G-code"},
|
||||||
".gcode": {"G-code"},
|
".gcode": {"G-code"},
|
||||||
".gd": {"GAP", "GDScript"},
|
".gd": {"GDScript", "GAP"},
|
||||||
".gdb": {"GDB"},
|
".gdb": {"GDB"},
|
||||||
".gdbinit": {"GDB"},
|
".gdbinit": {"GDB"},
|
||||||
".gemspec": {"Ruby"},
|
".gemspec": {"Ruby"},
|
||||||
@ -315,7 +315,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".glf": {"Glyph"},
|
".glf": {"Glyph"},
|
||||||
".glsl": {"GLSL"},
|
".glsl": {"GLSL"},
|
||||||
".glslv": {"GLSL"},
|
".glslv": {"GLSL"},
|
||||||
".gml": {"Game Maker Language", "Graph Modeling Language", "XML"},
|
".gml": {"Graph Modeling Language", "Game Maker Language", "XML"},
|
||||||
".gms": {"GAMS"},
|
".gms": {"GAMS"},
|
||||||
".gn": {"GN"},
|
".gn": {"GN"},
|
||||||
".gni": {"GN"},
|
".gni": {"GN"},
|
||||||
@ -331,7 +331,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".groovy": {"Groovy"},
|
".groovy": {"Groovy"},
|
||||||
".grt": {"Groovy"},
|
".grt": {"Groovy"},
|
||||||
".grxml": {"XML"},
|
".grxml": {"XML"},
|
||||||
".gs": {"Genie", "Gosu", "JavaScript"},
|
".gs": {"JavaScript", "Genie", "Gosu"},
|
||||||
".gshader": {"GLSL"},
|
".gshader": {"GLSL"},
|
||||||
".gsp": {"Groovy Server Pages"},
|
".gsp": {"Groovy Server Pages"},
|
||||||
".gst": {"Gosu"},
|
".gst": {"Gosu"},
|
||||||
@ -341,7 +341,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".gvy": {"Groovy"},
|
".gvy": {"Groovy"},
|
||||||
".gyp": {"Python"},
|
".gyp": {"Python"},
|
||||||
".gypi": {"Python"},
|
".gypi": {"Python"},
|
||||||
".h": {"C", "C++", "Objective-C"},
|
".h": {"C", "Objective-C", "C++"},
|
||||||
".h++": {"C++"},
|
".h++": {"C++"},
|
||||||
".haml": {"Haml"},
|
".haml": {"Haml"},
|
||||||
".haml.deface": {"Haml"},
|
".haml.deface": {"Haml"},
|
||||||
@ -378,7 +378,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".ik": {"Ioke"},
|
".ik": {"Ioke"},
|
||||||
".ily": {"LilyPond"},
|
".ily": {"LilyPond"},
|
||||||
".iml": {"XML"},
|
".iml": {"XML"},
|
||||||
".inc": {"Assembly", "C++", "HTML", "PAWN", "PHP", "POV-Ray SDL", "Pascal", "SQL", "SourcePawn"},
|
".inc": {"Assembly", "POV-Ray SDL", "HTML", "PHP", "PAWN", "Pascal", "C++", "SQL", "SourcePawn"},
|
||||||
".ini": {"INI"},
|
".ini": {"INI"},
|
||||||
".inl": {"C++"},
|
".inl": {"C++"},
|
||||||
".ino": {"Arduino"},
|
".ino": {"Arduino"},
|
||||||
@ -425,7 +425,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".kt": {"Kotlin"},
|
".kt": {"Kotlin"},
|
||||||
".ktm": {"Kotlin"},
|
".ktm": {"Kotlin"},
|
||||||
".kts": {"Kotlin"},
|
".kts": {"Kotlin"},
|
||||||
".l": {"Common Lisp", "Lex", "PicoLisp", "Roff"},
|
".l": {"Roff", "Common Lisp", "PicoLisp", "Lex"},
|
||||||
".lagda": {"Literate Agda"},
|
".lagda": {"Literate Agda"},
|
||||||
".las": {"Lasso"},
|
".las": {"Lasso"},
|
||||||
".lasso": {"Lasso"},
|
".lasso": {"Lasso"},
|
||||||
@ -446,7 +446,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".lid": {"Dylan"},
|
".lid": {"Dylan"},
|
||||||
".lidr": {"Idris"},
|
".lidr": {"Idris"},
|
||||||
".liquid": {"Liquid"},
|
".liquid": {"Liquid"},
|
||||||
".lisp": {"Common Lisp", "NewLisp"},
|
".lisp": {"NewLisp", "Common Lisp"},
|
||||||
".litcoffee": {"Literate CoffeeScript"},
|
".litcoffee": {"Literate CoffeeScript"},
|
||||||
".ll": {"LLVM"},
|
".ll": {"LLVM"},
|
||||||
".lmi": {"Python"},
|
".lmi": {"Python"},
|
||||||
@ -454,15 +454,15 @@ var languagesByExtension = map[string][]string{
|
|||||||
".lol": {"LOLCODE"},
|
".lol": {"LOLCODE"},
|
||||||
".lookml": {"LookML"},
|
".lookml": {"LookML"},
|
||||||
".lpr": {"Pascal"},
|
".lpr": {"Pascal"},
|
||||||
".ls": {"LiveScript", "LoomScript"},
|
".ls": {"LoomScript", "LiveScript"},
|
||||||
".lsl": {"LSL"},
|
".lsl": {"LSL"},
|
||||||
".lslp": {"LSL"},
|
".lslp": {"LSL"},
|
||||||
".lsp": {"Common Lisp", "NewLisp"},
|
".lsp": {"NewLisp", "Common Lisp"},
|
||||||
".ltx": {"TeX"},
|
".ltx": {"TeX"},
|
||||||
".lua": {"Lua"},
|
".lua": {"Lua"},
|
||||||
".lvproj": {"LabVIEW"},
|
".lvproj": {"LabVIEW"},
|
||||||
".ly": {"LilyPond"},
|
".ly": {"LilyPond"},
|
||||||
".m": {"Limbo", "M", "MUF", "Mathematica", "Matlab", "Mercury", "Objective-C"},
|
".m": {"M", "Limbo", "Objective-C", "MUF", "Matlab", "Mercury", "Mathematica"},
|
||||||
".m4": {"M4", "M4Sugar"},
|
".m4": {"M4", "M4Sugar"},
|
||||||
".ma": {"Mathematica"},
|
".ma": {"Mathematica"},
|
||||||
".mak": {"Makefile"},
|
".mak": {"Makefile"},
|
||||||
@ -511,7 +511,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".mmk": {"Module Management System"},
|
".mmk": {"Module Management System"},
|
||||||
".mms": {"Module Management System"},
|
".mms": {"Module Management System"},
|
||||||
".mo": {"Modelica"},
|
".mo": {"Modelica"},
|
||||||
".mod": {"AMPL", "Linux Kernel Module", "Modula-2", "XML"},
|
".mod": {"Linux Kernel Module", "AMPL", "Modula-2", "XML"},
|
||||||
".model.lkml": {"LookML"},
|
".model.lkml": {"LookML"},
|
||||||
".monkey": {"Monkey"},
|
".monkey": {"Monkey"},
|
||||||
".moo": {"Mercury", "Moocode"},
|
".moo": {"Mercury", "Moocode"},
|
||||||
@ -519,7 +519,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".mq4": {"MQL4"},
|
".mq4": {"MQL4"},
|
||||||
".mq5": {"MQL5"},
|
".mq5": {"MQL5"},
|
||||||
".mqh": {"MQL4", "MQL5"},
|
".mqh": {"MQL4", "MQL5"},
|
||||||
".ms": {"MAXScript", "Roff", "Unix Assembly"},
|
".ms": {"Roff", "Unix Assembly", "MAXScript"},
|
||||||
".mspec": {"Ruby"},
|
".mspec": {"Ruby"},
|
||||||
".mss": {"CartoCSS"},
|
".mss": {"CartoCSS"},
|
||||||
".mt": {"Mathematica"},
|
".mt": {"Mathematica"},
|
||||||
@ -533,10 +533,10 @@ var languagesByExtension = map[string][]string{
|
|||||||
".mxt": {"Max"},
|
".mxt": {"Max"},
|
||||||
".mysql": {"SQL"},
|
".mysql": {"SQL"},
|
||||||
".myt": {"Myghty"},
|
".myt": {"Myghty"},
|
||||||
".n": {"Nemerle", "Roff"},
|
".n": {"Roff", "Nemerle"},
|
||||||
".nasm": {"Assembly"},
|
".nasm": {"Assembly"},
|
||||||
".nawk": {"Awk"},
|
".nawk": {"Awk"},
|
||||||
".nb": {"Mathematica", "Text"},
|
".nb": {"Text", "Mathematica"},
|
||||||
".nbp": {"Mathematica"},
|
".nbp": {"Mathematica"},
|
||||||
".nc": {"nesC"},
|
".nc": {"nesC"},
|
||||||
".ncl": {"NCL", "Text"},
|
".ncl": {"NCL", "Text"},
|
||||||
@ -549,7 +549,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".nix": {"Nix"},
|
".nix": {"Nix"},
|
||||||
".njk": {"HTML+Django"},
|
".njk": {"HTML+Django"},
|
||||||
".njs": {"JavaScript"},
|
".njs": {"JavaScript"},
|
||||||
".nl": {"NL", "NewLisp"},
|
".nl": {"NewLisp", "NL"},
|
||||||
".nlogo": {"NetLogo"},
|
".nlogo": {"NetLogo"},
|
||||||
".no": {"Text"},
|
".no": {"Text"},
|
||||||
".nproj": {"XML"},
|
".nproj": {"XML"},
|
||||||
@ -604,7 +604,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".pde": {"Processing"},
|
".pde": {"Processing"},
|
||||||
".perl": {"Perl"},
|
".perl": {"Perl"},
|
||||||
".ph": {"Perl"},
|
".ph": {"Perl"},
|
||||||
".php": {"Hack", "PHP"},
|
".php": {"PHP", "Hack"},
|
||||||
".php3": {"PHP"},
|
".php3": {"PHP"},
|
||||||
".php4": {"PHP"},
|
".php4": {"PHP"},
|
||||||
".php5": {"PHP"},
|
".php5": {"PHP"},
|
||||||
@ -619,7 +619,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".pkgproj": {"XML"},
|
".pkgproj": {"XML"},
|
||||||
".pkl": {"Pickle"},
|
".pkl": {"Pickle"},
|
||||||
".pks": {"PLSQL"},
|
".pks": {"PLSQL"},
|
||||||
".pl": {"Perl", "Perl6", "Prolog"},
|
".pl": {"Prolog", "Perl", "Perl6"},
|
||||||
".pl6": {"Perl6"},
|
".pl6": {"Perl6"},
|
||||||
".plb": {"PLSQL"},
|
".plb": {"PLSQL"},
|
||||||
".plist": {"XML"},
|
".plist": {"XML"},
|
||||||
@ -633,14 +633,14 @@ var languagesByExtension = map[string][]string{
|
|||||||
".pm6": {"Perl6"},
|
".pm6": {"Perl6"},
|
||||||
".pmod": {"Pike"},
|
".pmod": {"Pike"},
|
||||||
".po": {"Gettext Catalog"},
|
".po": {"Gettext Catalog"},
|
||||||
".pod": {"Perl", "Pod"},
|
".pod": {"Pod", "Perl"},
|
||||||
".podsl": {"Common Lisp"},
|
".podsl": {"Common Lisp"},
|
||||||
".podspec": {"Ruby"},
|
".podspec": {"Ruby"},
|
||||||
".pogo": {"PogoScript"},
|
".pogo": {"PogoScript"},
|
||||||
".pony": {"Pony"},
|
".pony": {"Pony"},
|
||||||
".pot": {"Gettext Catalog"},
|
".pot": {"Gettext Catalog"},
|
||||||
".pov": {"POV-Ray SDL"},
|
".pov": {"POV-Ray SDL"},
|
||||||
".pp": {"Pascal", "Puppet"},
|
".pp": {"Puppet", "Pascal"},
|
||||||
".pprx": {"REXX"},
|
".pprx": {"REXX"},
|
||||||
".prc": {"SQL"},
|
".prc": {"SQL"},
|
||||||
".prefab": {"Unity3D Asset"},
|
".prefab": {"Unity3D Asset"},
|
||||||
@ -678,7 +678,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".pyx": {"Cython"},
|
".pyx": {"Cython"},
|
||||||
".qbs": {"QML"},
|
".qbs": {"QML"},
|
||||||
".qml": {"QML"},
|
".qml": {"QML"},
|
||||||
".r": {"R", "Rebol"},
|
".r": {"Rebol", "R"},
|
||||||
".r2": {"Rebol"},
|
".r2": {"Rebol"},
|
||||||
".r3": {"Rebol"},
|
".r3": {"Rebol"},
|
||||||
".rabl": {"Ruby"},
|
".rabl": {"Ruby"},
|
||||||
@ -699,7 +699,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".rd": {"R"},
|
".rd": {"R"},
|
||||||
".rdf": {"XML"},
|
".rdf": {"XML"},
|
||||||
".rdoc": {"RDoc"},
|
".rdoc": {"RDoc"},
|
||||||
".re": {"C++", "Reason"},
|
".re": {"Reason", "C++"},
|
||||||
".reb": {"Rebol"},
|
".reb": {"Rebol"},
|
||||||
".rebol": {"Rebol"},
|
".rebol": {"Rebol"},
|
||||||
".red": {"Red"},
|
".red": {"Red"},
|
||||||
@ -727,7 +727,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".ron": {"Markdown"},
|
".ron": {"Markdown"},
|
||||||
".rpy": {"Python", "Ren'Py"},
|
".rpy": {"Python", "Ren'Py"},
|
||||||
".rq": {"SPARQL"},
|
".rq": {"SPARQL"},
|
||||||
".rs": {"RenderScript", "Rust"},
|
".rs": {"Rust", "RenderScript"},
|
||||||
".rs.in": {"Rust"},
|
".rs.in": {"Rust"},
|
||||||
".rsc": {"Rascal"},
|
".rsc": {"Rascal"},
|
||||||
".rsh": {"RenderScript"},
|
".rsh": {"RenderScript"},
|
||||||
@ -751,7 +751,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".scaml": {"Scaml"},
|
".scaml": {"Scaml"},
|
||||||
".scd": {"SuperCollider"},
|
".scd": {"SuperCollider"},
|
||||||
".sce": {"Scilab"},
|
".sce": {"Scilab"},
|
||||||
".sch": {"Eagle", "KiCad", "XML"},
|
".sch": {"KiCad", "Eagle", "XML"},
|
||||||
".sci": {"Scilab"},
|
".sci": {"Scilab"},
|
||||||
".scm": {"Scheme"},
|
".scm": {"Scheme"},
|
||||||
".sco": {"Csound Score"},
|
".sco": {"Csound Score"},
|
||||||
@ -774,7 +774,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".sl": {"Slash"},
|
".sl": {"Slash"},
|
||||||
".sld": {"Scheme"},
|
".sld": {"Scheme"},
|
||||||
".slim": {"Slim"},
|
".slim": {"Slim"},
|
||||||
".sls": {"SaltStack", "Scheme"},
|
".sls": {"Scheme", "SaltStack"},
|
||||||
".sma": {"SourcePawn"},
|
".sma": {"SourcePawn"},
|
||||||
".smali": {"Smali"},
|
".smali": {"Smali"},
|
||||||
".sml": {"Standard ML"},
|
".sml": {"Standard ML"},
|
||||||
@ -782,14 +782,14 @@ var languagesByExtension = map[string][]string{
|
|||||||
".smt2": {"SMT"},
|
".smt2": {"SMT"},
|
||||||
".sp": {"SourcePawn"},
|
".sp": {"SourcePawn"},
|
||||||
".sparql": {"SPARQL"},
|
".sparql": {"SPARQL"},
|
||||||
".spec": {"Python", "RPM Spec", "Ruby"},
|
".spec": {"Python", "Ruby", "RPM Spec"},
|
||||||
".spin": {"Propeller Spin"},
|
".spin": {"Propeller Spin"},
|
||||||
".sps": {"Scheme"},
|
".sps": {"Scheme"},
|
||||||
".sqf": {"SQF"},
|
".sqf": {"SQF"},
|
||||||
".sql": {"PLSQL", "PLpgSQL", "SQL", "SQLPL"},
|
".sql": {"PLpgSQL", "PLSQL", "SQL", "SQLPL"},
|
||||||
".sra": {"PowerBuilder"},
|
".sra": {"PowerBuilder"},
|
||||||
".srdf": {"XML"},
|
".srdf": {"XML"},
|
||||||
".srt": {"SRecode Template", "SubRip Text"},
|
".srt": {"SubRip Text", "SRecode Template"},
|
||||||
".sru": {"PowerBuilder"},
|
".sru": {"PowerBuilder"},
|
||||||
".srw": {"PowerBuilder"},
|
".srw": {"PowerBuilder"},
|
||||||
".ss": {"Scheme"},
|
".ss": {"Scheme"},
|
||||||
@ -822,7 +822,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".svh": {"SystemVerilog"},
|
".svh": {"SystemVerilog"},
|
||||||
".swift": {"Swift"},
|
".swift": {"Swift"},
|
||||||
".syntax": {"YAML"},
|
".syntax": {"YAML"},
|
||||||
".t": {"Perl", "Perl6", "Terra", "Turing"},
|
".t": {"Turing", "Perl", "Terra", "Perl6"},
|
||||||
".tab": {"SQL"},
|
".tab": {"SQL"},
|
||||||
".tac": {"Python"},
|
".tac": {"Python"},
|
||||||
".targets": {"XML"},
|
".targets": {"XML"},
|
||||||
@ -853,7 +853,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".tpl": {"Smarty"},
|
".tpl": {"Smarty"},
|
||||||
".tpp": {"C++"},
|
".tpp": {"C++"},
|
||||||
".ts": {"TypeScript", "XML"},
|
".ts": {"TypeScript", "XML"},
|
||||||
".tst": {"GAP", "Scilab"},
|
".tst": {"Scilab", "GAP"},
|
||||||
".tsx": {"TypeScript", "XML"},
|
".tsx": {"TypeScript", "XML"},
|
||||||
".ttl": {"Turtle"},
|
".ttl": {"Turtle"},
|
||||||
".tu": {"Turing"},
|
".tu": {"Turing"},
|
||||||
@ -890,7 +890,7 @@ var languagesByExtension = map[string][]string{
|
|||||||
".vhf": {"VHDL"},
|
".vhf": {"VHDL"},
|
||||||
".vhi": {"VHDL"},
|
".vhi": {"VHDL"},
|
||||||
".vho": {"VHDL"},
|
".vho": {"VHDL"},
|
||||||
".vhost": {"ApacheConf", "Nginx"},
|
".vhost": {"Nginx", "ApacheConf"},
|
||||||
".vhs": {"VHDL"},
|
".vhs": {"VHDL"},
|
||||||
".vht": {"VHDL"},
|
".vht": {"VHDL"},
|
||||||
".vhw": {"VHDL"},
|
".vhw": {"VHDL"},
|
||||||
|
@ -21,13 +21,6 @@ func (s *TSuite) TestIsVendor(c *C) {
|
|||||||
func (s *TSuite) TestIsDocumentation(c *C) {
|
func (s *TSuite) TestIsDocumentation(c *C) {
|
||||||
c.Assert(IsDocumentation("foo"), Equals, false)
|
c.Assert(IsDocumentation("foo"), Equals, false)
|
||||||
c.Assert(IsDocumentation("README"), Equals, true)
|
c.Assert(IsDocumentation("README"), Equals, true)
|
||||||
c.Assert(IsDocumentation("samples/something"), Equals, true)
|
|
||||||
c.Assert(IsDocumentation("Docs/whatever"), Equals, true)
|
|
||||||
c.Assert(IsDocumentation("/javadoc/*"), Equals, true)
|
|
||||||
c.Assert(IsDocumentation("License"), Equals, true)
|
|
||||||
c.Assert(IsDocumentation("CONTRIBUTING.bar"), Equals, true)
|
|
||||||
c.Assert(IsDocumentation("/CHANGES"), Equals, true)
|
|
||||||
c.Assert(IsDocumentation("INSTALL"), Equals, true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TSuite) TestIsConfiguration(c *C) {
|
func (s *TSuite) TestIsConfiguration(c *C) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user