aboutcode-org / aboutcode-org/license-expression

SPDX validation should consider arbitrary expressions in format `<KNOWN-LICENSE-ID>"+"` as valid

未關閉
#110 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
73
分支
33
PR 合併指標
30 天內沒有已合併 PR

描述

SPDX license expression allow the following Simple license expressions:
> An SPDX License List Short Form Identifier with a unary "+" operator suffix to represent the current version of the license or any later version. For example: `CDDL-1.0+`

spec & docs:
- https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/#simple-license-expressions
- https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/#d3-simple-license-expressions

## request

make the validator and parser support SPDX License Identifiers with a `+` at the end.

## reproduce

I tested with exactly this example `CDDL-1.0+` value, but got a negative, where I expected a positive:

tested with `license-expression==30.4.1`
```py
>>> from license_expression import get_spdx_licensing
>>> lic = get_spdx_licensing()

>>> lic.validate('CDDL-1.0')
ExpressionInfo(
original_expression='CDDL-1.0',
normalized_expression='CDDL-1.0',
errors=[],
invalid_symbols=[]
)

>>> lic.validate('CDDL-1.0+')
ExpressionInfo(
original_expression='CDDL-1.0+',
normalized_expression=None,
errors=['Unknown license key(s): CDDL-1.0+'],
invalid_symbols=['CDDL-1.0+']
)

>>> lic.validate('MIT OR CDDL-1.0+')
ExpressionInfo(
original_expression='MIT OR CDDL-1.0+',
normalized_expression=None,
errors=['Unknown license key(s): CDDL-1.0+'],
invalid_symbols=['CDDL-1.0+']
)
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。