Currently we use languages hard coded in Gitea code. We should probably switch to using go-enry method to get language type and include only programming and markup languages in stats:
https://github.com/go-enry/go-enry/blob/dc6fc02209b37a02b64eed383a5f281059e86eac/common.go#L453
Markup should be included too (HTML, CSS)
FWIW, GitHub does not hide either HTML or CSS from their stats.
Yes, hence why should most likely allow Markup along with Programming type.
Ah, misunderstood you. I wonder if we would have to include more then we currently exclude.
@lafriks if we only include programming languages, then https://gitea.com/gitea/blog would be a go project ... - dont know if this is the right way ...
Idear: can we add a reposetting "excluded lang in status: xy, abc, ..."
Idear: can we add a reposetting "excluded lang in status: xy, abc, ..."
I'd just do it via .gitattributes
, that way it's portable and would work both on GitHub and Gitea. The relevant attribute to mark a glob undetectable is -linguist-detectable
.
@6543 no it would be HTML project :) We do already exclude Markdown: https://github.com/go-gitea/gitea/blob/dc812f8ba5bf1c123fa948afed15c4309da8fb45/modules/git/repo_language_stats.go#L33
first we need .gitattributes parser ;) tho it should probably be part of go-git
project
go-enry
indicates in the README that it wants to support .gitattributes
, maybe it shoud be there:
https://github.com/go-enry/go-enry#divergences-from-linguist
Most helpful comment
I'd just do it via
.gitattributes
, that way it's portable and would work both on GitHub and Gitea. The relevant attribute to mark a glob undetectable is-linguist-detectable
.