Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable result order for entries with equal confidence #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rockdaboot
Copy link

In case of two result entries with equal confidence level, the order of these entries is randomized. This makes comparing two result sets non-trivial.

This PR orders the result entries by confidence first and by license name second to achieve a stable output.

Example:
The two top entries have the same confidence level and thus appear either as

$ ./license-detector https://github.com/gogo/protobuf | head -3
https://github.com/gogo/protobuf
        100%    BSD-2-Clause
        100%    0BSD

or as

https://github.com/gogo/protobuf
        100%    0BSD
        100%    BSD-2-Clause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant