Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ohecker committed Feb 7, 2024
1 parent c6f5074 commit 82548f0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public enum LogMessages {
+ "skipped due to unkown SPDX: {}, mapped using type SCANCODE: {}, mapped using type OSS-SPDX: {}, mapped to IGNORE: {}"), //
NOT_A_VALID_NPM_PACKAGE_NAME(67, "{} is not a valid name for an NPM package"), //
SCANCODE_ISSUE_DETECTION_REGEX(68,
"The list of regular expressions for detecting licenses having issues is set to '{}'");
"The list of regular expressions for detecting licenses from scancode having issues is set to '{}'");

private final String message;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package com.devonfw.tools.solicitor.componentinfo.scancode;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spdx.library.model.license.LicenseInfoFactory;
Expand Down Expand Up @@ -174,9 +170,8 @@ protected boolean isBlacklisted(String license) {
*/
protected boolean isToBeIgnored(String license) {

return this.mappingIgnorelistPredicate.test(license,
"License id '{}' matches ignore list via regex '{}' and "
+ "will be mapped to a NormalizedLicense using pseudo license Ignore");
return this.mappingIgnorelistPredicate.test(license, "License id '{}' matches ignore list via regex '{}' and "
+ "will be mapped to a NormalizedLicense using pseudo license Ignore");
}

/**
Expand Down Expand Up @@ -223,7 +218,7 @@ public void setModelFactory(ModelFactory modelFactory) {
* @param licenseIdMappingBlacklistRegexes an array of regular expressions which define a blacklist of license ids
* which will not be mapped automatically to {@link NormalizedLicense} information.
*/
@Value("${solicitor.scancode.automapping.blacklist}")
@Value("${solicitor.scancode.automapping.blacklistpatterns}")
public void setLicenseIdMappingBlacklistRegexes(String[] licenseIdMappingBlacklistRegexes) {

this.mappingBlacklistPredicate.setRegexes(licenseIdMappingBlacklistRegexes);
Expand All @@ -235,7 +230,7 @@ public void setLicenseIdMappingBlacklistRegexes(String[] licenseIdMappingBlackli
* @param licenseIdMappingIgnorelistRegexes an array of regular expressions which define a list of license ids which
* will be mapped to @link NormalizedLicense} information using type/pseudolicense IGNORE/Ignore.
*/
@Value("${solicitor.scancode.automapping.ignorelist}")
@Value("${solicitor.scancode.automapping.ignorelistpatterns}")
public void setLicenseIdMappingIgnorelistRegexes(String[] licenseIdMappingIgnorelistRegexes) {

this.mappingIgnorelistPredicate.setRegexes(licenseIdMappingIgnorelistRegexes);
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ solicitor.feature-flag.scancode=false
# Attempt automatic mapping of scancode license ids to NormalizedLicenses
solicitor.feature-flag.scancode.automapping=true
# comma separated list of regular expressions which define the scancode license ids which will not be automatically mapped
solicitor.scancode.automapping.blacklist=.*unknown.*,.*proprietary.*
solicitor.scancode.automapping.blacklistpatterns=.*unknown.*,.*proprietary.*
# comma separated list of regular expressions which define the scancode license ids which will be mapped to IGNORE/Ignore
solicitor.scancode.automapping.ignorelist=
solicitor.scancode.automapping.ignorelistpatterns=

## Parameters for controlling the processing of scancode information
# minimum score of detected license findings to be taken into account for Solicitor processing
Expand Down
4 changes: 2 additions & 2 deletions documentation/files/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ solicitor.feature-flag.scancode=false
# Attempt automatic mapping of scancode license ids to NormalizedLicenses
solicitor.feature-flag.scancode.automapping=true
# comma separated list of regular expressions which define the scancode license ids which will not be automatically mapped
solicitor.scancode.automapping.blacklist=.*unknown.*,.*proprietary.*
solicitor.scancode.automapping.blacklistpatterns=.*unknown.*,.*proprietary.*
# comma separated list of regular expressions which define the scancode license ids which will be mapped to IGNORE/Ignore
solicitor.scancode.automapping.ignorelist=
solicitor.scancode.automapping.ignorelistpatterns=

## Parameters for controlling the processing of scancode information
# minimum score of detected license findings to be taken into account for Solicitor processing
Expand Down
4 changes: 2 additions & 2 deletions documentation/master-solicitor.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1461,8 +1461,8 @@ The ignorelist allows to automatically map licenses so that they are ignored in

The default is:
----
solicitor.scancode.automapping.blacklist=.*unknown.*,.*proprietary.*
solicitor.scancode.automapping.ignorelist=
solicitor.scancode.automapping.blacklistpatterns=.*unknown.*,.*proprietary.*
solicitor.scancode.automapping.ignorelistpatterns=
----
This prohibits automatic mapping of licenses ids which are ambiguous. No ignore mapping is done by default.

Expand Down

0 comments on commit 82548f0

Please sign in to comment.