-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(bundler): Switch to ast-grep
parser
#37153
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
base: main
Are you sure you want to change the base?
Conversation
|
The commit focuses on adding proper handling of `optional` groups for Ruby gems in the Bundler manager.
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.
otherwise LGTM
{ depName: 'sfn_my_dep1', currentValue: '"~> 1"' }, | ||
{ depName: 'sfn_my_dep2', currentValue: '"~> 1"' }, | ||
{ | ||
currentValue: '~> 1', |
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.
interesting, we extract without quotes. you need to check the ruby versioning if it needs the quotes!
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 strips them when needed
strings: TemplateStringsArray, | ||
...values: any[] | ||
): NapiConfig { | ||
return parseSingleYaml<NapiConfig>(strings[0]); |
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.
why so many arguments, when we only use the first string? 🤔
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.
Let's merge after v42
Changes
Gemfile Parser
A comprehensive Ruby Gemfile parser for Renovate built with AST-grep. The parser is organized into focused modules:
index.ts
-parseGemfile()
top-level functioncommon.ts
- Shared AST utilities and Ruby language loading, i.g. variable resolutiongem.ts
- Gem name/version parsing (gem "rails", "~> 7.0"
)git.ts
- Git dependency handling (git:
,github:
,ref:
,tag:
,branch:
)group-scope.ts
- Dependency groups and scoping (group :development do ... end
)ruby-version.ts
- Ruby version requirements (ruby "2.7.1"
)source-scope.ts
- Registry/source URL management (source "https://..." do ... end
)Handles complex Gemfile syntax including nested groups, source blocks, variable resolution, version constraints, and edge cases.
Context
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: