github/linguist — pull request #1661 by ScrimpyCat (2014-11-03 06:43:02+00:00)
Title: Use all languages returned by heuristics not just the first

Solution for issue https://github.com/github/linguist/issues/1656

No accompanying tests, unsure what the best way to test this would be. Maybe the test could be setup by replacing Heuristics.find_by_heuristics with our test one, and setting up the Classifier with made up fixtures or something. And then just testing the correct language is returned.

Code: Check if there is only one language returned by the heuristics, if so return that language (this behaves the same way it would in previous versions). If there are multiple filter out those which are not found in the possible language names array and use the classifier to determine which one it most likely is.