Repository: scala-steward-org/scala-steward (scala)

Issue:
Prettify DependencyOutdated log statement
Hello there ✋ ,

Could we please prettify the log statement below because it's currently very verbose and hard to understand?

Cheers 🍺 

```
DependencyOutdated(CrossDependency(NonEmptyList(Dependency(io.dropwizard.metrics,ArtifactId(metrics-core,None),3.2.6,None,None,None))),Single(CrossDependency(NonEmptyList(Dependency(io.dropwizard.metrics,ArtifactId(metrics-core,None),3.2.6,None,None,None))),NonEmptyList(4.1.5),None))
```

Pull request:
fixes #1391

Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/update/PruningAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/update/PruningAlg.scala
index fd5bce4aaf..3e91827df7 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/update/PruningAlg.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/update/PruningAlg.scala
@@ -143,7 +143,7 @@ final class PruningAlg[F[_]](implicit
       }.separate
       val isOutdated = outdatedStates.nonEmpty
       val message = if (isOutdated) {
-        val states = util.string.indentLines(outdatedStates.map(_.toString).sorted)
+        val states = util.string.indentLines(outdatedStates.map(UpdateState.show).sorted)
         s"${repo.show} is outdated:\n" + states
       } else
         s"${repo.show} is up-to-date"


Test patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/update/data/UpdateState.scala b/modules/core/src/main/scala/org/scalasteward/core/update/data/UpdateState.scala
index 2f4a3e51b8..dda8d70fa9 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/update/data/UpdateState.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/update/data/UpdateState.scala
@@ -50,4 +50,23 @@ object UpdateState {
       update: Update.Single,
       pullRequest: Uri
   ) extends UpdateState
+
+  def show(updateState: UpdateState): String = {
+    val groupId = updateState.crossDependency.head.groupId
+    val artifacts = updateState.crossDependency.showArtifactNames
+    val version = updateState.crossDependency.head.version
+    val gav = s"$groupId:$artifacts : $version"
+    updateState match {
+      case DependencyUpToDate(_) =>
+        s"up-to-date: $gav"
+      case DependencyOutdated(_, update) =>
+        s"new version: $gav -> ${update.newerVersions.head}"
+      case PullRequestUpToDate(_, update, pullRequest) =>
+        s"PR opened: $gav -> ${update.newerVersions.head} ($pullRequest)"
+      case PullRequestOutdated(_, update, pullRequest) =>
+        s"PR outdated: $gav -> ${update.newerVersions.head} ($pullRequest)"
+      case PullRequestClosed(_, update, pullRequest) =>
+        s"PR closed: $gav -> ${update.newerVersions.head} ($pullRequest)"
+    }
+  }
 }
diff --git a/modules/core/src/test/scala/org/scalasteward/core/update/PruningAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/update/PruningAlgTest.scala
index 14bb5b82d7..01fa95b32b 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/update/PruningAlgTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/update/PruningAlgTest.scala
@@ -295,7 +295,7 @@ class PruningAlgTest extends AnyFunSuite with Matchers {
         (None, "Found 1 update:\n  org.scala-lang:scala-library : 2.12.10 -> 2.12.11"),
         (
           None,
-          "fthomas/scalafix-test is outdated:\n  DependencyOutdated(CrossDependency(NonEmptyList(Dependency(org.scala-lang,ArtifactId(scala-library,None),2.12.10,None,None,None))),Single(CrossDependency(NonEmptyList(Dependency(org.scala-lang,ArtifactId(scala-library,None),2.12.10,None,None,None))),NonEmptyList(2.12.11),None))"
+          "fthomas/scalafix-test is outdated:\n  new version: org.scala-lang:scala-library : 2.12.10 -> 2.12.11"
         )
       )
     )