Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[semver] allows invalid version number 1.0.0-beta..1, not allowed by semver.org suggested regex #21383

Copy link
Copy link
@o-l-a-v

Description

@o-l-a-v
Issue body actions

Prerequisites

Steps to reproduce

Here are some examples of invalid semantic versioning version numbers that are not valid by semver.org suggested regex:

## Should work
[semver]'1'
[semver]'1.0.0'
[semver]'1.0.0-beta'
[semver]'1.0.0-beta1'
[semver]'1.0.0-beta.1'

## Should error but doesn't
[semver]'1.0.0-beta..1'
[semver]'1.0.0-beta...1'

## Should error and does
[semver]'1.0.0-beta!1'

This tells me [semver] isn't fully compliant with semantic versioning v2.0.0.

Additional search tags:

  • SemanticVersion, [SemanticVersion]
  • System.Management.Automation.SemanticVersion, [System.Management.Automation.SemanticVersion]

Expected behavior

Follow semver specification. Throw an error on non-valid version numbers. Like with [semver]'1.0.0-beta!1' which gives:

InvalidArgument: Cannot convert value "1.0.0-beta!1" to type "System.Management.Automation.SemanticVersion". Error: "The input string '' was not in a correct format."

Actual behavior

PS > [semver]'1.0.0-beta...1'

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
1      0      0      beta...1

PS >

Error details

No response

Environment data

  • PowerShell v7.4.1 x64
  • Windows 11 23H2 x64

Visuals

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.