Skip to content

Commit 65dfdc8

Browse files
committed
review
1 parent e6131eb commit 65dfdc8

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

docs/repo-specific-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ updates.pin = [ { groupId = "com.example", artifactId="foo", version = "1.1." }
104104
# Defaults to empty `[]` which mean Scala Steward will not ignore dependencies.
105105
updates.ignore = [ { groupId = "org.acme", artifactId="foo", version = "1.0" } ]
106106

107-
# The dependencies which match the given pattern are retracted: Their existing Pull-Request will be closed.
107+
# The dependencies which match the given pattern are retracted. Their existing pull-request will be closed.
108108
#
109-
# Each entry must have a `reason, a `doc` URL and a list of dependency patterns.
109+
# Each entry must have a `reason`, a `doc` URL and a list of dependency patterns.
110110
updates.retracted = [
111111
{
112112
reason = "Ignore version 3.6.0 as it is abandoned due to broken compatibility",

modules/core/src/main/scala/org/scalasteward/core/application/StewardAlg.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ final class StewardAlg[F[_]](config: Config)(implicit
5454
dataAndFork <- repoCacheAlg.checkCache(repo)
5555
(data, fork) = dataAndFork
5656
_ <- nurtureAlg.closeRetractedPullRequests(data)
57-
states <- pruningAlg.needsAttention(data)
58-
result <- states.traverse_(states =>
57+
statesO <- pruningAlg.needsAttention(data)
58+
result <- statesO.traverse_(states =>
5959
nurtureAlg.nurture(data, fork, states.map(_.update))
6060
)
6161
} yield result,

modules/core/src/main/scala/org/scalasteward/core/nurture/PullRequestRepository.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ final class PullRequestRepository[F[_]](kvStore: KeyValueStore[F, Repo, Map[Uri,
8585
repo: Repo,
8686
allRetractedArtifacts: List[RetractedArtifact]
8787
): F[List[(PullRequestData[Id], RetractedArtifact)]] =
88-
kvStore.getOrElse(repo, Map.empty).map { pullRequets: Map[Uri, Entry] =>
88+
kvStore.getOrElse(repo, Map.empty).map { pullRequets =>
8989
pullRequets.flatMap {
9090
case (
9191
url,

modules/core/src/main/scala/org/scalasteward/core/repoconfig/RetractedArtifact.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ final case class RetractedArtifact(
3434
}
3535

3636
def retractionMsg: String =
37-
s"""|Retracted because of: ${reason}.
37+
s"""|PR retracted because of: ${reason}.
3838
|
3939
|Documentation: ${doc}
40-
|""".stripMargin.trim
40+
|""".stripMargin
4141
}
4242

4343
object RetractedArtifact {

modules/core/src/test/scala/org/scalasteward/core/nurture/PullRequestRepositoryTest.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,24 @@ class PullRequestRepositoryTest extends FunSuite {
150150
assertEquals(obtained.head._2, retractedPortableScala)
151151
}
152152

153+
test("getRetractedPullRequests with retractions for different version") {
154+
val retractedPortableScala = RetractedArtifact(
155+
"a reason",
156+
"doc URI",
157+
List(
158+
UpdatePattern(
159+
"org.portable-scala".g,
160+
Some("sbt-scalajs-crossproject"),
161+
Some(VersionPattern(exact = Some("2.0.0")))
162+
)
163+
)
164+
)
165+
val (_, obtained) = beforeAndAfterPRCreation(portableScala) { repo =>
166+
pullRequestRepository.getRetractedPullRequests(repo, List(retractedPortableScala))
167+
}
168+
assertEquals(obtained, List.empty[(PullRequestData[Id], RetractedArtifact)])
169+
}
170+
153171
test("findLatestPullRequest ignores grouped updates") {
154172
val (_, result) = beforeAndAfterPRCreation(groupedUpdate(portableScala)) { repo =>
155173
pullRequestRepository.findLatestPullRequest(repo, portableScala.crossDependency, "1.0.0".v)

modules/docs/mdoc/repo-specific-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ updates.pin = [ { groupId = "com.example", artifactId="foo", version = "1.1." }
110110
# Defaults to empty `[]` which mean Scala Steward will not ignore dependencies.
111111
updates.ignore = [ { groupId = "org.acme", artifactId="foo", version = "1.0" } ]
112112

113-
# The dependencies which match the given pattern are retracted: Their existing Pull-Request will be closed.
113+
# The dependencies which match the given pattern are retracted. Their existing pull-request will be closed.
114114
#
115-
# Each entry must have a `reason, a `doc` URL and a list of dependency patterns.
115+
# Each entry must have a `reason`, a `doc` URL and a list of dependency patterns.
116116
updates.retracted = [
117117
{
118118
reason = "Ignore version 3.6.0 as it is abandoned due to broken compatibility",

0 commit comments

Comments
 (0)