Skip to content

Add License File Specification Syntax Check #2

@sco1

Description

@sco1

PEP 639 specifies some constraints on the syntax used by license-files:

Its value is an array of strings which MUST contain valid glob patterns, as specified below:

  • Alphanumeric characters, underscores (_), hyphens (-) and dots (.) MUST be matched verbatim.
  • Special glob characters: *, ?, ** and character ranges: [] containing only the verbatim matched characters MUST be supported. Within [...], the hyphen indicates a locale-agnostic range (e.g. a-z, order based on Unicode code points). Hyphens at the start or end are matched literally.
  • Path delimiters MUST be the forward slash character (/). Patterns are relative to the directory containing pyproject.toml, therefore the leading slash character MUST NOT be used.
  • Parent directory indicators (..) MUST NOT be used.

While some of these we can gain natively through using pathlib's pattern language, we should be able to add a couple more explicit checks beyond this.

To be more explicit, the existing check-license-glob should also be renamed, perhaps to check-glob-resolve?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions