Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING(semver): remove the handling of non-standard SemVers in format function #5587

Merged
merged 3 commits into from
Jul 31, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jul 31, 2024

What's changed

format currently handles NaN semvers ({ major: NaN, minor: NaN, patch: NaN }) or Infinity semvers (such as { major: Infinity, minor: Infinity, patch: Infinity }) in a special way.

This change stops those special handlings.

Motivation

The infinity SemVers or NaN SemVers don't represent valid semantic versions, and they are not part of the semver spec. It's not reasonable to handle them in a special way, but rather we should consider them invalid versions.

Migration

Do not use these non-standard semvers as sentinel values. Instead use comparison functions such as compare, greaterThan, lessThan, greaterThanRange, lessThanRange, etc for checking semver conditions.

@kt3k kt3k changed the title BREAKING(semver): remove the handling of infinity SemVers BREAKING(semver): remove the handling of non-standard SemVers in format function Jul 31, 2024
Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.49%. Comparing base (b328265) to head (aa621a1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5587   +/-   ##
=======================================
  Coverage   96.49%   96.49%           
=======================================
  Files         465      465           
  Lines       37753    37727   -26     
  Branches     5576     5570    -6     
=======================================
- Hits        36429    36404   -25     
  Misses       1282     1282           
+ Partials       42       41    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I agree with this.

semver/format_test.ts Show resolved Hide resolved
semver/format.ts Show resolved Hide resolved
@kt3k kt3k merged commit 3d09aa3 into denoland:main Jul 31, 2024
13 checks passed
@kt3k kt3k deleted the breaking-semver-infinty-semvers branch July 31, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants