fix: recognize linguist language aliases (#39135)

Co-authored-by: loveulvu <ax9inl@google.com>
This commit is contained in:
Even
2026-08-26 23:24:07 +08:00
committed by GitHub
parent e21c37703e
commit 3005efa88d
2 changed files with 15 additions and 0 deletions
@@ -114,6 +114,10 @@ func GetLanguageStats(ctx context.Context, repo *git.Repository, commitID string
if hasLanguage := attrs.GetLanguage(); hasLanguage.Value() != "" {
language := hasLanguage.Value()
if canonicalLanguage, ok := enry.GetLanguageByAlias(language); ok {
language = canonicalLanguage
}
// group languages, such as Pug -> HTML; SCSS -> CSS
group := enry.GetLanguageGroup(language)
if len(group) != 0 {