diff --git a/internal/languages/language.go b/internal/languages/language.go index 7f111075..ec76d945 100644 --- a/internal/languages/language.go +++ b/internal/languages/language.go @@ -16,6 +16,9 @@ import ( ) var unsupportedByLinguistAliasMap = map[string]string{ + // Extensions for the Apex programming language + // See https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm + "apex": "Apex", // Pkl Configuration Language (https://pkl-lang.org/) // Add to linguist on 6/7/24 // can remove once go-enry package updates @@ -26,6 +29,11 @@ var unsupportedByLinguistAliasMap = map[string]string{ } var unsupportedByLinguistExtensionToNameMap = map[string]string{ + ".apex": "Apex", + ".apxt": "Apex", + ".apxc": "Apex", + ".cls": "Apex", + ".trigger": "Apex", // Pkl Configuration Language (https://pkl-lang.org/) ".pkl": "Pkl", // Magik Language diff --git a/internal/languages/language_test.go b/internal/languages/language_test.go index 294c6777..25e2382a 100644 --- a/internal/languages/language_test.go +++ b/internal/languages/language_test.go @@ -39,6 +39,12 @@ func TestGetLanguageByAlias(t *testing.T) { want: "Magik", wantOk: true, }, + { + name: "apex example unsupported by linguist alias", + alias: "apex", + want: "Apex", + wantOk: true, + }, } for _, tt := range tests { @@ -77,11 +83,17 @@ func TestGetLanguage(t *testing.T) { want: "Go", }, { - name: "unsupported by linguist extension", + name: "magik: unsupported by linguist extension", filename: "file.magik", content: []byte(""), want: "Magik", }, + { + name: "apex: unsupported by linguist extension", + filename: "file.apxc", + content: []byte(""), + want: "Apex", + }, } for _, tt := range tests {