-
Notifications
You must be signed in to change notification settings - Fork 8
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
add scalafix rule to migrate code from Typesafe Config to sconfig #191
Conversation
after publishing, this would be executed by running ``` scalafix dependency:ReplaceTypesafeConfig@org.ekrich:sconfig-scalafix:1.4.5 ```
@bpholt I am not all that familiar with Scalafix but typesafe config is Java and this project is Scala. See lightbend/config#600 I think any changes need to be ported by hand. |
Sorry, I should have given more context. This is intended to be used in a Scala codebase that was originally written using the Java library and wants to convert to sconfig. Scalafix lets one define rewrite rules / refactorings that can modify a project's source code—it's often used to aid upgrades across versions that have source incompatibilities. For example, http4s uses it to rewrite package names when they moved things around. I added some tests which I think also demonstrate how this would be used—see |
…at the rule is narrowly tailored
So I guess what you are saying that I publish this Scalafix rule to Maven. Then a user would use this rule by adding it to their There was this issue but never had time to investigate - #67 |
As we discussed in Discord, I'm going to add some documentation on how to use this to the readme. |
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.
I made suggestions just to be really clear about what I was thinking but feel free to improve the wording. Just would like to avoid updating as versions change. A scalafix tag from Maven would probably be better but I just thought of that.
Please make the changes yourself so I won't be a co-author as you deserve all the credit.
Something went batty above - sorry. |
My understanding is that all the processing for badges happens on the backend—from the perspective of the README markdown, they're just images included in the page. (The corollary being that sometimes there are caching issues and the badges don't update right away when new versions are published.) I think I updated the readme with all your suggestions, but let me know if I missed anything! |
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.
I am trying to wrap my head around versionsBase
. It seems that this capability is only applicable to JVM projects so if we need to publish all the Scala versions then it should be versionsJVM
assuming this will work on Scala 3 codebases.
That's where I started, but it didn't seem like Scalafix was published for Scala 3 yet—at least not on Maven Central. (Their website describes Scalafix for Scala 3 as "experimental" and says not everything works yet.) I figured it was good enough to start with the Scala 2 versions and then we can add Scala 3 once Scalafix supports it better. |
@bpholt LGTM - thanks for your contribution. |
after publishing, this would be executed by running
This rule is just a starting point. I think theoretically it could be added to over time, to support additional rewrites like removing the empty parens from certain method calls, etc.