aboutcode-org / aboutcode-org/scancode-toolkit

Custom rules are not detected or applied without custom license

未关闭
#3,926 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
2.6k
派生
791
平均合并
1 天 12 小时
30 天内合并 PR
5

描述

### Description

> Please leave a brief description of the bug or feature request:

Custom rules to identify existing licenses (apache-2.0, proprietary-license...) are not being applied.
The rules are added in a designates rules folder. An empty licenses folder is added as well in order to have `scancode-reindex-licenses --additional-directory ./additional_licenses_rules` succeed. If a licenses folder is not added, that step will fail anyway. The folder contains a dummy license `example1.LICENSE`.

### How To Reproduce

> Tell us how to reproduce the issue.

runs in CI
```
- apt-get update -qq
- apt-get install -y python3.10-dev bzip2 xz-utils zlib1g libxml2-dev libxslt1-dev libpopt0 libgomp1
- pip install --trusted-host pypi......com scancode-toolkit[full]
- mkdir scancode-results
- scancode-reindex-licenses --additional-directory ./additional_licenses_rules/
- scancode -clpeui -n 8 --json-pp scancode-results/scan_output.json --license-score 55 --ignore "*.js" --ignore "*.html" --ignore "*.png" --ignore "**/licenses/**" --ignore "**/rules/**" .
```
folder layout
```
project/additional_licenses_rules (feat/license-jarne)
$ ls -a
./ ../ licenses/ rules/
```
The rules folder contains multiple .RULES files e.g. apache-2.0_st.RULE, proprietary-license_intel.RULE

apache-2.0_st.RULE
```
---
license_expression: apache-2.0
is_license_notice: yes
---

Copyright (c) 2024 STMicroelectronics.
All rights reserved.

This software is licensed under terms that can be found in the LICENSE file
in the root directory of this software component.
If no LICENSE file comes with this software, it is provided AS-IS.
```

### System configuration

> For bug reports, it really helps us to know:

* What OS are you running on? (Windows/MacOS/Linux) in CI: "Linux-5.15.0-113-generic-x86_64-with-glibc2.39",, "platform_version": "# 123-Ubuntu ...", "python_version": "3.10.15"
* What version of scancode-toolkit was used to generate the scan file? "32.2.1"
* What installation method was used to install/run scancode? (pip/source download/other)
```
- apt-get update -qq
- apt-get install -y python3.10-dev bzip2 xz-utils zlib1g libxml2-dev libxslt1-dev libpopt0 libgomp1
- pip install --trusted-host pypi......com scancode-toolkit[full]
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。