GitHub fails to determine the repository language

513 Views Asked by At

I use GitHub for a C++ / Qt project. GitHub automatically determines the languages of the project from the file extentions. Problem: Qt has a file name ProjectName.pro, which is interpreted to be Prolog by GitHub.

How can I indicate it is NOT Prolog, but C++ ?

2

There are 2 best solutions below

0
AudioBubble On

It is actually a known issue: https://github.com/github/linguist/issues/394

It's been submitted 6 month ago but GitHub still doesn't bother fixing it... Do you think of any workaround ?

0
N. Faure On

As said in the original issue (https://github.com/github/linguist/issues/394):

Linguist now supports custom overrides for language definitions and custom vendor paths

So in order to finally have Qt project files properly recognized as C++ in language statistics, you can add this line in your .gitattributes file.

*.pro linguist-language=C++

See https://github.com/github/linguist#overrides for more details.