-
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 ability to propose sbt version update #665
Conversation
modules/core/src/main/scala/org/scalasteward/core/edit/UpdateHeuristic.scala
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #665 +/- ##
==========================================
+ Coverage 60.26% 60.52% +0.26%
==========================================
Files 78 78
Lines 1042 1059 +17
Branches 21 20 -1
==========================================
+ Hits 628 641 +13
- Misses 414 418 +4
Continue to review full report at Codecov.
|
ff33f5e
to
0ce2cd7
Compare
Thanks @exoego for working on this. I think a few more things are needed for this feature:
I'm not sure if we then need a new |
0ce2cd7
to
7676425
Compare
Updated |
modules/core/src/main/scala/org/scalasteward/core/sbt/SbtAlg.scala
Outdated
Show resolved
Hide resolved
7676425
to
a45d616
Compare
modules/core/src/main/scala/org/scalasteward/core/sbt/SbtAlg.scala
Outdated
Show resolved
Hide resolved
modules/core/src/main/scala/org/scalasteward/core/sbt/SbtAlg.scala
Outdated
Show resolved
Hide resolved
I just tested your branch with one of my repos and it works: fthomas/properly#26 I also pushed two minor fixes. |
I tried this on a few more repos:
And they all look good. The only one that also updated some unrelated version number was this: I'm not sure yet if we should restrict sbt updates to |
It looks like
I think restriction is needed. // Update.Single
final case class Single(
groupId: String,
artifactId: String,
currentVersion: String,
newerVersions: Nel[String],
configurations: Option[String] = None,
fileReestrictions: Option[Regex] = None
) extends Update {
// SbtAlg
Update.Single("org.scala-sbt", "sbt", currentVer, Nel.of(newVer),
Some("build.properties".r))
// EditAlg
def applyUpdateTo[G[_]: Traverse](files: G[File], update: Update): F[Unit] = {
val actions = UpdateHeuristic.all.map { heuristic =>
logger.info(s"Trying heuristic '${heuristic.name}'") >>
// RESTRICTION HERE
fileAlg.editFiles(files, heuristic.replaceF(update))
}
bindUntilTrue(actions).void
} |
The file restriction would be computed in This would restrict sbt updates to only edit |
Added such dynamic
To use sbt version somewhere in build, I think users should use the sbt key |
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.
LGTM! Thanks again, @exoego!
kubukoz/sup#84 it works, thanks for this update! |
Closes #101.
Steward will propose update if they found
sbt.version=X.Y.Z-SOMETHING
.It does not update
SbtVersion
that used for conditional build like belowsince such build requires cautious update.
I could not find how to perform system-test against actual repos...
How should I perform ?