-
Notifications
You must be signed in to change notification settings - Fork 1k
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
bump corepack to fix freezes #11126
bump corepack to fix freezes #11126
Changes from 3 commits
9971523
0c2b5f9
5f35e1c
a56e1ed
64bc0a0
767d79b
2e7289d
47dd89e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ def self.semver_for(version) | |
|
||
sig { override.params(version: VersionParameter).void } | ||
def initialize(version) | ||
version = clean_version(version) | ||
@version_string = T.let(version.to_s, String) | ||
version = version.gsub(/^v/, "") if version.is_a?(String) | ||
@build_info = T.let(nil, T.nilable(String)) | ||
|
@@ -71,6 +72,18 @@ def initialize(version) | |
super(T.must(version)) | ||
end | ||
|
||
sig { params(version: VersionParameter).returns(VersionParameter) } | ||
def clean_version(version) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review Tip: |
||
# Check if version is a string before attempting to match | ||
# Matches @ followed by x.y.z (digits separated by dots) | ||
if version.is_a?(String) && (match = version.match(/@(\d+\.\d+\.\d+)/)) | ||
return match[1] # Just "4.5.3" | ||
end | ||
|
||
# If version is not a string or no match found, return original version | ||
version | ||
end | ||
|
||
sig { override.params(version: VersionParameter).returns(Dependabot::NpmAndYarn::Version) } | ||
def self.new(version) | ||
T.cast(super, Dependabot::NpmAndYarn::Version) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 67 is also cleaning a version string; can we consolidate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is also moved.