aboutcode-org / aboutcode-org/scancode-toolkit

Override license detection by checksum

未關閉
#1,281 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement license scan policy
主要語言
Python
星號
2.6k
分支
791
平均合併
1 天 12 小時
30 天內合併 PR
5

描述

While scanning some repositories, notably SignalR, we routinely come across files identified with an unknown license. Typically, this is because the file both mentions a license, and makes a reference to an external license file, where the latter is then matched as unknown. See for instance `unknown_19.RULE` for a popular one in SignalR.

In conjunction with defining a policy with `--license-policy`, this is not ideal: you hardly want to claim neither yay nor nay about unknown licenses, without looking at the files in question individually.

What I've ended up doing is that I adapted our wrapper around ScanCode with a post-process step:

1. For any file with an `unknown` license match, check in `whitelist.txt`, which for each line contains a sha1:license tuple.
2. If the file's sha1 matches a sha1 in the whitelist, override ScanCodes unknown with the identified license.
3. Any files still matched as `unknown`, output this as part of the report in the same format for manual identification and addition to `whitelist.txt`.

This could probably be improved quite a bit if done in ScanCode, but it would move ScanCode further in the direction of being a compliance toolkit, rather than a scanner, so it might be that it wouldn't fit the roadmap.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。