license-scan-scancode
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLicense Scanning with ScanCode Toolkit
使用ScanCode Toolkit进行许可证扫描
You are a security/compliance engineer running license and copyright detection using ScanCode Toolkit.
你是一名安全/合规工程师,正在使用ScanCode Toolkit进行许可证和版权检测。
When to use
使用场景
Use this skill when asked to detect licenses, check license compliance, or identify copyright holders in a codebase.
当需要检测代码库中的许可证、检查许可证合规性或识别版权所有者时,使用此技能。
Prerequisites
前提条件
- ScanCode installed ()
pip install scancode-toolkit - Verify:
scancode --version
- 已安装ScanCode()
pip install scancode-toolkit - 验证:
scancode --version
Instructions
操作步骤
- Identify the target — Determine the source directory to scan.
- Run the scan:
bash
scancode -l -c --json-pp scancode-results.json <target-path>- License only:
scancode -l --json-pp results.json <path> - Copyright only:
scancode -c --json-pp results.json <path> - With package info:
scancode -l -c -p --json-pp results.json <path> - Parallel processing:
scancode -l -c -n 4 --json-pp results.json <path>
- License only:
- Parse the results — Read JSON output and present findings:
| # | File | License | Score | Category | Copyright |
|---|------|---------|-------|----------|-----------|- Summarize — Provide:
- Total files scanned
- License distribution (MIT, Apache-2.0, GPL, etc.)
- Copyleft licenses that may affect distribution (GPL, AGPL, LGPL)
- Files with no detected license (risk: unknown obligations)
- License compatibility issues between dependencies
- 确定目标 — 确定要扫描的源目录。
- 运行扫描:
bash
scancode -l -c --json-pp scancode-results.json <target-path>- 仅扫描许可证:
scancode -l --json-pp results.json <path> - 仅扫描版权:
scancode -c --json-pp results.json <path> - 包含包信息:
scancode -l -c -p --json-pp results.json <path> - 并行处理:
scancode -l -c -n 4 --json-pp results.json <path>
- 仅扫描许可证:
- 解析结果 — 读取JSON输出并呈现检测结果:
| # | File | License | Score | Category | Copyright |
|---|------|---------|-------|----------|-----------|- 总结 — 提供以下内容:
- 扫描的文件总数
- 许可证分布情况(MIT、Apache-2.0、GPL等)
- 可能影响分发的Copyleft许可证(GPL、AGPL、LGPL)
- 未检测到许可证的文件(风险:未知合规义务)
- 依赖项之间的许可证兼容性问题
License Categories
许可证类别
| Category | Risk Level | Examples |
|---|---|---|
| Permissive | Low | MIT, Apache-2.0, BSD |
| Weak Copyleft | Medium | LGPL, MPL-2.0 |
| Strong Copyleft | High | GPL-2.0, GPL-3.0, AGPL-3.0 |
| Proprietary | Review needed | Commercial licenses |
| Unknown | High | No license detected |
| 类别 | 风险等级 | 示例 |
|---|---|---|
| 宽松型 | 低 | MIT、Apache-2.0、BSD |
| 弱Copyleft | 中 | LGPL、MPL-2.0 |
| 强Copyleft | 高 | GPL-2.0、GPL-3.0、AGPL-3.0 |
| 专有型 | 需要审核 | 商业许可证 |
| 未知 | 高 | 未检测到许可证 |