github-linguist / linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
MIT License
12.15k stars 4.21k forks source link

CoffeeScript repo with no Perl...it's getting detected as a mostly-Perl repo #1472

Closed gruiz17 closed 10 years ago

gruiz17 commented 10 years ago

My repo sidescroller-stars is mostly CoffeeScript (besides HTML, CSS, and compiled JS). I don't think I have any Perl up in there. But linguist is saying it's over 70% Perl.

What could be causing linguist to do this?

pchaigno commented 10 years ago

This is because it's executable. Thus, LInguist considers every script languages as potential candidates (we could probably improve that...).

gruiz17 commented 10 years ago

Oh weird, so is it considering the Cakefile as a Perl script?

pchaigno commented 10 years ago

Yes it is.

gruiz17 commented 10 years ago

Oh, that's really weird. I thought linguist detected Cakefiles as Coffeescript.

pchaigno commented 10 years ago

Not exactly. It only detects Coffeescript as a potential candidates for Cakefiles. But because your file is executable, all script languages are also candidates. And, in your case, the Bayesian classifier (who then chose the best candidate) wasn't able to detect it properly.

If you make your Cakefile non executable it should be detected as Coffeescript.

gruiz17 commented 10 years ago

Alright, that solved it, thanks!