scancode-toolkit icon indicating copy to clipboard operation
scancode-toolkit copied to clipboard

Custom rules are not detected or applied without custom license

Open JarneVdP opened this issue 1 year ago • 3 comments

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]

JarneVdP avatar Sep 20 '24 12:09 JarneVdP