aboutcode-org / aboutcode-org/scancode-toolkit

Custom rules are not detected or applied without custom license

Abierto
#3,926 3 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
2.6k
Forks
791
Merge medio
1 d 12 h
PR fusionados (30 d)
5

Descripción

### 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]
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.