license-checker-rseidelsohn
license-checker-rseidelsohn copied to clipboard
`--unknown` flag is not respected when license is guessed as "Undefined", "UNLICENSED", or "Public Domain"
The --unknown
flag is described as having the following effect:
report guessed licenses as unknown licenses
From reviewing the code, it looks like this works by appending a *
to guessed licenses (e.g. here), and then replacing licenses that end in *
with UNKNOWN
.
However, in a few cases the getLicenseTitle
function doesn't append a '*', which means those license strings propagate even when --unknown
is passed. The ones I can spot are "Undefined", "Public Domain", "Custom:
The naive solution here would be to append a '*' onto those licenses too - but I wonder if it's worth considering a refactor here. Rather than trying to detect guessed licenses, could we consider skipping the guessing functionality entirely when --unknown
is passed?