[ 
https://issues.apache.org/jira/browse/RAT-583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18145351#comment-18145351
 ] 

ASF subversion and git services commented on RAT-583:
-----------------------------------------------------

Commit 8f161ad4c88ed6950026c188dc7b76a112419bfa in creadur-rat's branch 
refs/heads/feature/complexSPDXmatcherParsing from Philipp Ottlinger
[ https://gitbox.apache.org/repos/asf?p=creadur-rat.git;h=8f161ad4c ]

RAT-583: Split regexp to fix sonar warning


> The SPDX matcher reads only the first identifier - improve SPDX parser
> ----------------------------------------------------------------------
>
>                 Key: RAT-583
>                 URL: https://issues.apache.org/jira/browse/RAT-583
>             Project: Apache RAT
>          Issue Type: Improvement
>          Components: license-meta-data
>    Affects Versions: 0.18
>            Reporter: Sean Palmer
>            Priority: Major
>             Fix For: 0.19
>
>
> {{SPDXMatcherFactory}} uses 
> {{.*SPDX-License-Identifier:\s([A-Za-z0-9\.\-]+)}}, which captures only the 
> first token after the tag, and requires exactly one whitespace character 
> before it. Operators, later identifiers, and parentheses are ignored, so the 
> verdict can be wrong in both directions:
> ||SPDX-License-Identifier||Reported by RAT 0.18||Expected||
> |Apache-2.0 OR GPL-3.0-only|AL2.0 (approved)|approved|
> |GPL-3.0-only OR Apache-2.0|GPL3 (unapproved)|approved|
> |Apache-2.0 AND GPL-3.0-only|AL2.0 (approved)|unapproved|
> |(Apache-2.0 OR MIT)|Unknown license|approved|
> |Apache-2.0 (two spaces after the colon)|Unknown license|AL2.0|
> Found while investigating 
> https://github.com/apache/tooling-trusted-releases/issues/1725.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to