From 90ab35a7caf6aafafc98124518f89a5118e832e1 Mon Sep 17 00:00:00 2001 From: Aliasghar Jawadwala Date: Sun, 1 Feb 2026 17:36:41 +0530 Subject: [PATCH] Fix false-positive detection of generic 'open source license' phrase Moved free-unknown_88.RULE to inactive directory as it was causing false positives when scanning casual documentation that mentions 'open source license'. This resolves issue #4221 where ts-jest README was incorrectly flagged with LicenseRef-scancode-free-unknown. The rule matched only 3 words ('open source license') with low relevance (50), making it too broad and triggering on non-licensing contexts. Added test case to prevent regression: - tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md - tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md.yml Fixes: #4221 Signed-off-by: Aliasghar Jawadwala --- .../{ => inactive}/rules/free-unknown_88.RULE | 0 .../unknown/ts-jest-no-false-positive.md | 19 +++++++++++++++++++ .../unknown/ts-jest-no-false-positive.md.yml | 2 ++ 3 files changed, 21 insertions(+) rename src/licensedcode/data/{ => inactive}/rules/free-unknown_88.RULE (100%) create mode 100644 tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md create mode 100644 tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md.yml diff --git a/src/licensedcode/data/rules/free-unknown_88.RULE b/src/licensedcode/data/inactive/rules/free-unknown_88.RULE similarity index 100% rename from src/licensedcode/data/rules/free-unknown_88.RULE rename to src/licensedcode/data/inactive/rules/free-unknown_88.RULE diff --git a/tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md b/tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md new file mode 100644 index 00000000000..1d2ad98a8b0 --- /dev/null +++ b/tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md @@ -0,0 +1,19 @@ +# ts-jest + +A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript. + +## Features + +ts-jest is open source and free to use. + +The project is actively maintained and welcomes contributions. + +## Installation + +You can install ts-jest using npm: + +```bash +npm install --save-dev ts-jest +``` + +This project is released under an open source license. diff --git a/tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md.yml b/tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md.yml new file mode 100644 index 00000000000..1882c7bddee --- /dev/null +++ b/tests/licensedcode/data/datadriven/unknown/ts-jest-no-false-positive.md.yml @@ -0,0 +1,2 @@ +license_expressions: [] +notes: Casual mentions of "open source license" in documentation should not trigger license detection. This test verifies free-unknown_88.RULE (deactivated) does not cause false positives.