Apache2 许可证检查器
用于验证兼容的Apachi2许可证的项目依赖性的自动许可证检查器.
用您的项目
- 运行
npm install @bbc/apache2-license-checker --save-dev - 修改您的
package.json包括apache2-license-checker作为你的一部分 测试 脚本
例如:
...
"scripts": {
"test": "mocha && npm run check-licenses",
"check-licenses": "apache2-license-checker"
},
...
执照检查会失败的 退出代码 联 合 国 1 如果驾照有任何问题, 将会通过一个 退出代码 联 合 国 0 如果所有的支票都没事.
临时文件 licenses.json 将创建包含基于该数据库产出的全面许可证分析 license-checker 工具。 你可能会想 .gitignore 这个文件.
创建例外
如果许可证检查器投出出错误,而你已经验证出错误为可接受的风险,那么你可能会想在本地项目中创建一个例外文件. 例如:
license-exceptions.json
{
"exceptions": {
"cosmos-deploy@*": {
"reason": "Not required, acceptable use for BBC internal deployments"
},
"[email protected]": {
"reason": "Public Domain; see: https://github.com/dscape/cycle/"
},
"[email protected]": {
"reason": "MIT License; see: https://github.com/dominictarr/map-stream"
},
"[email protected]": {
"reason": "Public Domain; see https://github.com/faisalman/ua-parser-js"
}
}
}
发展
支持
- 看看密码
- 运行
npm install - 运行
npm test
修改 scripts/whitelist.js 允许增加许可证或许可证组合.
修改 scripts/exceptions.js 以特定理由允许特定模块.
请推一枝并出取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取.
示例输出
在正常使用中运行 npm run check-licenses 生成类似于 :
Acceptable project licenses (uses):
(MIT AND CC-BY-3.0) (1)
Apache-2.0 (3)
BSD-2-Clause (1)
BSD-3-Clause (1)
ISC (15)
MIT (23)
Unlicense (1)
WTFPL (1)
Acceptable project license exceptions:
[email protected]
Reason: Not required, acceptable use for BBC internal deployments
[email protected]
Reason: Public Domain; see: https://github.com/dscape/cycle/
[email protected]
Reason: MIT License; see: https://github.com/dominictarr/map-stream
All licenses ok Licensed (46) Exceptions (0) Problems (0)
如果许可证有问题,则预期产出与下列情况相类似:
Acceptable project licenses (uses):
Apache-2.0 (3)
BSD-2-Clause (1)
BSD-3-Clause (1)
CC-BY-3.0 (1)
CC0-1.0 (1)
ISC (16)
MIT (25)
Acceptable project license exceptions:
[email protected]
Reason: Public Domain; see https://github.com/kemitchell/spdx-exceptions.json
Problems with the licenses for these dependencies:
[email protected]
License: CC0-1.0
Repository: https://github.com/shinnn/spdx-license-ids
Publisher: Shinnosuke Watanabe
Url: https://github.com/shinnn
Licenses not ok Licensed (46) Exceptions (1) Problems (1)