mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-09-20 07:21:22 +00:00
IsConfiguration: add&fix failing Python case to Go
test plan: * ENRY_TEST_REPO=".linguist" \ go test -run '^TestIsConfiguration$' github.com/go-enry/go-enry/v2
This commit is contained in:
parent
84c996dfcf
commit
7db593cb32
3
utils.go
3
utils.go
@ -16,11 +16,12 @@ var configurationLanguages = map[string]struct{}{
|
|||||||
"JSON": {},
|
"JSON": {},
|
||||||
"TOML": {},
|
"TOML": {},
|
||||||
"YAML": {},
|
"YAML": {},
|
||||||
|
"MiniYAML": {},
|
||||||
"INI": {},
|
"INI": {},
|
||||||
"SQL": {},
|
"SQL": {},
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsConfiguration tells if filename is in one of the configuration languages.
|
// IsConfiguration tells if a give file is in one of the configuration languages.
|
||||||
func IsConfiguration(path string) bool {
|
func IsConfiguration(path string) bool {
|
||||||
language, _ := GetLanguageByExtension(path)
|
language, _ := GetLanguageByExtension(path)
|
||||||
_, is := configurationLanguages[language]
|
_, is := configurationLanguages[language]
|
||||||
|
@ -139,6 +139,7 @@ func TestIsConfiguration(t *testing.T) {
|
|||||||
{name: "TestIsConfiguration_1", path: "foo", expected: false},
|
{name: "TestIsConfiguration_1", path: "foo", expected: false},
|
||||||
{name: "TestIsConfiguration_2", path: "foo.ini", expected: true},
|
{name: "TestIsConfiguration_2", path: "foo.ini", expected: true},
|
||||||
{name: "TestIsConfiguration_3", path: "/test/path/foo.json", expected: true},
|
{name: "TestIsConfiguration_3", path: "/test/path/foo.json", expected: true},
|
||||||
|
{name: "TestIsConfiguration_YAML", path: "configuration.yml", expected: true},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user