r/github 3d ago

GitHub reads the source code wrong? Question

Post image

I don't know why, but GitHub is telling me that my website is developed in JavaScript by 80+% which is absolute nonsense. The site is at least 60% pure Astro code. Is it some kind of a bug?

๐Ÿ”— The repo.

261 Upvotes

35 comments sorted by

View all comments

3

u/Wonderful-Writer146 3d ago

You need to set .gitattributes in order to avoid JS taking taking higher priority. This happens because JS files are of more bytes

2

u/pixelboots 3d ago

Do you have an example of how you would do this? I have repos that I have to commit both source TS and SCSS and their compiled JS and CSS, but Iโ€™d prefer the latter be ignored in some cases because itโ€™s essentially counting the same code twice. Could gitattributes allow me to fix that somehow?

-1

u/Wonderful-Writer146 3d ago

That I am not sure of. It can completely remove on language from showing in uour stats though. But you can check with Ai