Skip to content

complete SPDX license expression detection #424

@jkowalleck

Description

@jkowalleck

current SPDX license expression is stupid:

def is_compound_expression(value: str) -> bool:
"""Validate compound expression.
.. note::
Uses a best-effort detection of SPDX compound expression according to `SPDX license expression spec`_.
.. _SPDX license expression spec: https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/
"""
# shortest known valid expression: (A or B) - 8 characters long
return len(value) >= 8 \
and value.startswith('(') \
and value.endswith(')')

either have a proper complete implementation,
or use a library for this

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions