Negative percentages on the language bar

I was experimenting with the language display feature, and specifically with gitattributes and the linguist library. I noticed that after creating a repository with files in, supposedly, all languages possible with linguist, the language display seems a bit broken, displaying “-9.5%” for python and “106%” for other.


Here is the repository if anyone wants to take a look: GitHub - rphsoftware/github-moment: The language display is perfectly stable

Curious indeed. But then, the custom extensions which you’re associating to the various languages are pointing to files which are not in that language (all your files are just filled with full stops).

Linguist also handles syntax highlighting, so I wonder if language recognition might be playing a role here.

The strange thing is that percentages should still all add up to 100 — maybe that negative number is a buggy attempt to fix that!

I’m curious if these stats would somehow get straight if you actually replaced the file contents with valid code matching the defined extensions.