-
Notifications
You must be signed in to change notification settings - Fork 502
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 scala-collection-compact Scalafile rule when bump from 2.12 to 2.13 #2799
Add scala-collection-compact Scalafile rule when bump from 2.12 to 2.13 #2799
Conversation
Codecov ReportBase: 80.69% // Head: 80.69% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #2799 +/- ##
=======================================
Coverage 80.69% 80.69%
=======================================
Files 149 149
Lines 2865 2865
Branches 215 215
=======================================
Hits 2312 2312
Misses 553 553 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
} | ||
}, | ||
{ | ||
groupId: "org.scala-lang.modules", |
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.
question (blocking): Shouldn't this be run when updating Scala itself (instead of scala-collection-compat
)?
This comment follows the conventionalcomments.org standard
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.
That was my remark: I have the feeling that the rule is too specific to the collection itself while it should be more oriented to the scala version.
In this case, what should be the value of newVersion
? "2.13.0" or we case use a expression like 'newVersion = 2.13. ' to match any update to Scala 2.13 ?
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.
Yeah, I believe this should be:
{
groupId: "org.scala-lang",
artifactIds: ["scala-library", "scala-compiler", "scala-reflect", "scalap"],
newVersion: "2.13.0",
doc: "https://github.com/scala/scala-collection-compat#collection213upgrade",
rewriteRules: ["dependency:Collection213Upgrade@org.scala-lang.modules:scala-collection-migrations:2.8.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.
WDYT @exoego?
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.
Yeah, I think this makes more sense.
The docs of that rewrite also mention that this Scalafix requires scalacOptions: ["-P:semanticdb:synthetics:on"]
.
In this case, what should be the value of
newVersion
? "2.13.0" or we case use a expression like 'newVersion = 2.13. ' to match any update to Scala 2.13 ?
2.13.0
is fine because Scala Steward will use that the rule when it updates from a version < 2.13.0
to a version >= 2.13.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.
Then, if we all agree I can update the PR with your feedbacks?
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.
@fthomas @alejandrohdezma thanks for the feedback, I've rebased and updated the PR.
Tell me if it's good to you.
e62bdfc
to
3a83ab1
Compare
Thanks a lot for this! Any way that I can test it before the next release is tagged? |
If you are using the |
You don't need to use the latest Scala Steward version to test this. Scalafix migrations are available to all Scala Steward instances as soon as they are merged here (unless that is disabled by the |
Thank you both! |
Address #2770
I'm not sure if my rule is too specific to the
scala-compact-library
and should be more general to the scala bumping version.