-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(config-migration): preserve comments when migrating renovate.json
#38646
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?
feat(config-migration): preserve comments when migrating renovate.json
#38646
Conversation
c83ff25
to
9955a91
Compare
9955a91
to
b8b170f
Compare
b8b170f
to
ed31804
Compare
This was a lot more complicated than I thought. I can probably cleanup the logic a little more, but it's already too late here. I'm marking this as ready to review anyway to maybe collect some feedback. |
I'll probably create a library out of this, and name it This is generic and useful enough. The very few Renovate-specific things can be parameterized. Would keep the code in Renovate tidy as well. Please let me know if you have any objection with that. |
IMO, that sounds reasonable, @felipecrs! One thing to be cautious around is whether you'll be taking the net-new code into a new library, or if there's any code from inside Renovate that will need to go alongside it into the library. Given Renovate is Happy to help work out what makes sense here! |
Nothing from Renovate itself would compose the library, so no need to worry about that. But thanks for the hint! :D |
You're welcome! OK, in which case, wanna put this into a Draft PR state, so you can split the library out + then bring it back in here when that's ready? |
Changes
This PR leverages the
jsonc-morph
library to preserve comments and formatting when migratingrenovate.json
configuration files.In my opinion this is the last piece missing to make
renovate.json
the go-to configuration file format for Renovate. Perhaps deprecation ofrenovate.json5
can be even considered in the future.Context
Please select one of the below:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Note
I used Claude Sonnet 4.5 to kickstart
json-morph
magic, and then used it to generate the tests.However, I carefully reviewed and made substantial modifications to the generated code afterwards.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: