mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-10 05:22:23 +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": {},
|
||||
"TOML": {},
|
||||
"YAML": {},
|
||||
"MiniYAML": {},
|
||||
"INI": {},
|
||||
"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 {
|
||||
language, _ := GetLanguageByExtension(path)
|
||||
_, is := configurationLanguages[language]
|
||||
|
@ -139,6 +139,7 @@ func TestIsConfiguration(t *testing.T) {
|
||||
{name: "TestIsConfiguration_1", path: "foo", expected: false},
|
||||
{name: "TestIsConfiguration_2", path: "foo.ini", expected: true},
|
||||
{name: "TestIsConfiguration_3", path: "/test/path/foo.json", expected: true},
|
||||
{name: "TestIsConfiguration_YAML", path: "configuration.yml", expected: true},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
Loading…
Reference in New Issue
Block a user