Skip to content

complete SPDX license expression detection #424

Closed

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

Activity

  1. added
    enhancement
    on Sep 6, 2023
  2. self-assigned this
    on Sep 6, 2023
  3. changed the title [-]imrpove spdx license expression detection[/-] [+]complete SPDX license expression detection[/+] on Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions