Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github incorrectly recognizes programming language used in the project

Tags:

So I have a git repository that I wrote in C++, but github insists that I'm using D. Why is this and is there someway to correct it?

like image 294
Loourr Avatar asked Jun 23 '13 17:06

Loourr


People also ask

How does GitHub detect programming language?

GitHub uses the open source Linguist library to determine file languages for syntax highlighting and repository statistics. Language statistics will update after you push changes to your default branch.

How do I change the project language in GitHub?

You cannot change the language of the repository, but you can change the attributes of the github repository. I mean that if you have a project where there are 60% css and 40% javascript you can said to github-linguist, that you want to ignore the css file. this attributes ignore the java files.


1 Answers

Github uses it's own language parsing module and sometimes (actually often) it makes faults. Just write more code to make it easier for parser to choose what your main language is and after some time github will get it right.

In this particular case code parser is fooled by your files in STMC-C/Assignments/a* dirs with .d extension. That's an extension for D sources. The number of this sources dominated in your project so github decided that the main programming language used is D.

edit: Just found this public repo (github language detector) - it has some explanations of the system.

like image 200
sasha.sochka Avatar answered Nov 04 '22 18:11

sasha.sochka