Skip to content

Commit

Permalink
Remove yaml language detection
Browse files Browse the repository at this point in the history
  • Loading branch information
peti2001 committed Mar 19, 2022
1 parent 92803f0 commit 646f2a1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions languagedetection/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (

// LanguageAnalyzer used for detecting programming language of a file
type LanguageAnalyzer struct {
FileNameMap map[string]string
FileNameMap map[string]string
FileExtensionMap map[string]string
}

// NewLanguageAnalyzer constructor
func NewLanguageAnalyzer() *LanguageAnalyzer {
return &LanguageAnalyzer{
FileNameMap: reverseLanguageMap(fileNameMap),
FileNameMap: reverseLanguageMap(fileNameMap),
FileExtensionMap: reverseLanguageMap(fileExtensionMap),
}
}
Expand Down Expand Up @@ -97,12 +97,12 @@ func reverseLanguageMap(input map[string][]string) map[string]string {
}

var fileNameMap = map[string][]string{
"CMake": {"cmakelists.txt"},
"Dockerfile": {"dockerfile"},
"Go": {"go.mod"},
"Jenkins": {"jenkinsfile"},
"Makefile": {"gnumakefile", "makefile"},
"Ruby": {"gemfile", "rakefile"},
"CMake": {"cmakelists.txt"},
"Dockerfile": {"dockerfile"},
"Go": {"go.mod"},
"Jenkins": {"jenkinsfile"},
"Makefile": {"gnumakefile", "makefile"},
"Ruby": {"gemfile", "rakefile"},
}

var extensionsWithMultipleLanguages = map[string]bool{
Expand Down Expand Up @@ -183,6 +183,5 @@ var fileExtensionMap = map[string][]string{
"Xtend": {"xtend"},
"Xtext": {"xtext"},
"Yacc": {"y"},
"YAML": {"yaml", "yml"},
"Zig": {"zig"},
}

0 comments on commit 646f2a1

Please sign in to comment.