How are the language stats percentages calculated?

Thanks for Gitea, it’s pretty slick!

I have gotten an Ansible project pushed to my Gitea instance. Even though the majority of the project is YAML files, the language stats bar at the top of the repo only includes the Jinja2 templates and the single shell script that are part of the project. Why might the YAML files not be getting recognized? Is it because I’m using the .yml extension instead of .yaml? If so, how can I update the language stats functionality to include the .yml extension as a valid YAML extension?

Thanks again!

1 Like

We use the GitHub - go-enry/go-enry: A faster file programming language detector upstream library which calculates this information for us.

1 Like

Thanks very much for your help once more, @techknowlogick! :grinning_face_with_smiling_eyes:

I lightly perused the codebase for go-enry, hoping to find the answer. I haven’t written much code in years, so I got lost pretty quickly. Before I reach out to the go-enry team, might you have any ideas why .yml files might not be getting counted towards a Gitea repository’s language stats?

Off the top of my head, I know that it skips analyzing some things such in the case of a nodejs project it won’t say it is a json project because their lock file is json, but rather it would be a ts or js project. Perhaps that same logic is skipping yaml for your ansible playbook repo.

1 Like

That makes a lot of sense and is quite reasonable. You’re probably right.

To re-configure what types of files are counted for an individual repo, would that be something to do at the Gitea level or would it be more granular at the go-enry level?

I think it would be nice to support something like a .enryignore or .enryinclude file…

Thanks again for your insight, @techknowlogick! :smiley: