-
Notifications
You must be signed in to change notification settings - Fork 0
Fix version detection to support all semver formats and remove unused variable #5
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
Fix version detection to support all semver formats and remove unused variable #5
Conversation
Co-authored-by: mdaashir <85205726+mdaashir@users.noreply.github.com>
Co-authored-by: mdaashir <85205726+mdaashir@users.noreply.github.com>
Co-authored-by: mdaashir <85205726+mdaashir@users.noreply.github.com>
Co-authored-by: mdaashir <85205726+mdaashir@users.noreply.github.com>
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.
Pull request overview
This PR improves version detection in the dependencyAnalyzer tool to support all valid semver formats instead of only caret-prefixed versions. It also removes an unused variable.
Changes:
- Introduced a
getMajorVersion()helper function using regex to extract major versions from any semver format (^, ~, >=, >, <, exact versions, wildcards) - Refactored webpack and React version detection to use the new helper instead of
.startsWith('^')checks - Removed unused
contentvariable in go.mod detection block
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
…verage Co-authored-by: mdaashir <85205726+mdaashir@users.noreply.github.com>
Co-authored-by: mdaashir <85205726+mdaashir@users.noreply.github.com>
Applied all changes from the review thread:
All 31 functional tests now passing. |
…e I/O Co-authored-by: mdaashir <85205726+mdaashir@users.noreply.github.com>
The
dependencyAnalyzertool used fragile.startsWith('^')checks that only detected caret-prefixed versions, missing~4.0.0,>=4.0.0,4.46.0, and other valid semver formats.Changes
getMajorVersion()helper that extracts major version from any semver format (^,~,>=,>,<, exact, wildcards)contentvariable in go.mod detection blockgetMajorVersion()function to verify extraction from all semver formats and edge casesTesting
The changes are minimal and focused, improving the robustness of version detection while ensuring comprehensive test coverage.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.