Skip to content

Accept caret constraints with a wildcard major - #316

Open
jackwalkerlabs wants to merge 1 commit into
Masterminds:masterfrom
jackwalkerlabs:fix/caret-major-wildcard
Open

jackwalkerlabs wants to merge 1 commit into
Masterminds:masterfrom
jackwalkerlabs:fix/caret-major-wildcard

Conversation

@jackwalkerlabs

Copy link
Copy Markdown

^* is documented in the caret implementation as accepting any version, but currently rejects 0.1.0, 1.0.0, and other releases because its wildcard major is treated as a concrete zero.

After the existing prerelease and lower-bound checks, accept caret constraints with a wildcard major. Concrete ^0 and ^0.0 ranges continue through their existing bounds checks. Regressions cover *, x, X, multi-segment wildcards, both Check and Validate, and opt-in prerelease matching; all five wildcard groups fail on the base revision.

Validation: go test -race ./..., go vet ./..., gofmt and git diff --check pass on Go 1.27.1 / macOS arm64.

Disclosure: Codex implemented and tested this change under the submitting account's authorization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant