-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Problem
When running liccheck with -R, --reporting option, file is generated.
In cases when multiple licences apply to a package, the licence displayed in the file is nondeterministic.
Why we need deterministic behaviour:
We would like to generate a report with a pre-commit to keep updated licences information in our source code. Nondeterministic behaviour is preventing this from working reliably.
Analysis
The issue is in this line in the process function:
"license": (p["licenses"] or ["UNKNOWN"])[0],
The easiest way to make it deterministic is:
"license": sorted(p["licenses"] or ["UNKNOWN"])[0],
Even better is to show the full list:
"license": " | ".join(sorted(p["licenses"]) or ["UNKNOWN"]),
Metadata
Metadata
Assignees
Labels
No labels