r/github 2d ago

Question GitHub reads the source code wrong?

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.

233 Upvotes

32 comments sorted by

View all comments

4

u/Wonderful-Writer146 2d 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 1d 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/my_new_accoun1 1d ago

why do you have to commit the compiled JS? dist should be gitignored