You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to this change, GetLanguages collected all candidate languages from each
strategy to pass to the next strategy (without de-duplicating them). Linguist
only uses the previous strategy's candidates for the next strategy. Also, it
would overwrite languages with nil if a strategy returned that, so you could get
into a situation where you go from multiple languages to no language.
See the Ruby code for details: https://github.com/github/linguist/blob/0b23847af5a8a1e09e1547c0c502601b6dc599ff/lib/linguist.rb#L14-L43
This addresses src-d/enry#207 because GetLanguages
should not return all candidates detected, otherwise it would work differently
than Linguist.
look
added a commit
to look/go-enry
that referenced
this issue
Apr 13, 2021
Prior to this change, GetLanguages collected all candidate languages from each
strategy to pass to the next strategy (without de-duplicating them). Linguist
only uses the previous strategy's candidates for the next strategy. Also, it
would overwrite languages with nil if a strategy returned that, so you could get
into a situation where you go from multiple languages to no language.
See the Ruby code for details: https://github.com/github/linguist/blob/aad49acc0624c70d654a8dce447887dbbc713c7a/lib/linguist.rb#L14-L49
This addresses src-d/enry#207 because GetLanguages
should not return all candidates detected, otherwise it would work differently
than Linguist.
GetLanguages
accumulate candidates in case of no single match but never return thoseAs noted in #205 (comment) if that is changed in a naive way that fails tests.
This issue is about investigating and fixing that as well as assessing any possible side-effects of github.com//pull/205
The text was updated successfully, but these errors were encountered: