Skip to content

Validate plugin version numbers #112

Open
@ewels

Description

@ewels

See #110 (comment) - we should add validation of this to the JSON schema for CI.

Would this work @bentsherman ? https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string

^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$

Though maybe that's too permissive: https://regex101.com/r/RlYsCm/1

Would a simpler one ok?

^(\d+\.)?(\d+\.)?(\*|\d+)(-\w+)?$

(must be a 3-part numeric, with optional hyphen+alphanumerics at the end)

https://regex101.com/r/1fcwZM/1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions