Languages section of sidebar uses funny math, meter makes no sense #130287
-
Select Topic AreaQuestion BodyFor example, https://github.com/KudoAI/duckduckgpt has a few hundred lines of Python and thousands of lines of JS, yet the meter shows |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 23 replies
-
Man, you can click on each language and you will see files with code :D |
Beta Was this translation helpful? Give feedback.
-
It displays the Language that has most files, not most code. |
Beta Was this translation helpful? Give feedback.
-
You have file .user.js not .js - probably github doesn't take duckduckgpt.user.js file into calculations |
Beta Was this translation helpful? Give feedback.
-
It's possible the language detection tool might be malfunctioning and can't accurately calculate the code of each. Cause I went through the first repo and truly JS is more. You can submit an issue on that to GitHub. |
Beta Was this translation helpful? Give feedback.
-
Most likely Github has not recalculated the language statistics for your most recent push yet.
Github uses linguist to calculate the language percentages
|
Beta Was this translation helpful? Give feedback.
-
The guidelines over here will help you: |
Beta Was this translation helpful? Give feedback.
-
Fixing a misclassified language Most languages are detected by their file extension defined in languages.yml. For disambiguating between files with common extensions, Linguist applies some heuristics and a statistical classifier. This process can help differentiate between, for example, .h files which could be either C, C++, or Obj-C. Misclassifications can often be solved by either adding a new filename or extension for the language or adding more samples to make the classifier smarter. You can get the full documentation here: |
Beta Was this translation helpful? Give feedback.
-
The documentations I provided, just like what @aamijar provided, are 100% relavant to problem with the linguist which is what your question was about. Maybe instead of expecting a straightforward answer, which you won’t get, you should go through the documentation and follow the guidelines they’re providing to help navigate your problem. Just like I said earlier that I went through your repo to check, I also definitely went through the documentation to notice it was related before recommending. Is your question not about the language detection tool - Linguist? instead of just reading the topic about the documentation and concluding immediately that it doesn’t contain what you need, you should rather take time to read if you want your problem solved. Because the documentation does highlight a section that talks about having issues or bugs with the Linguist and possible causes and you ate to navigate them. |
Beta Was this translation helpful? Give feedback.
-
Hi @adamlui I think I have found the solution. Clone your repository
Notice that under JavaScript the file If you run
To avoid this file from being ignored by github-linguist as generated source code you can add this to your
After making a new commit your new language percentages should look like this.
|
Beta Was this translation helpful? Give feedback.
Hi @adamlui I think I have found the solution.
I was able to replicate the problem by using the following steps:
Clone your repository
Install and run
github-linguist
CLI tool