Skip to content

Commit

Permalink
Deduplicate inputs in inspect command output (#1558)
Browse files Browse the repository at this point in the history
Pull request: #1558
  • Loading branch information
lefou committed Nov 8, 2021
1 parent 03e8a92 commit 0337220
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main/src/mill/main/ReplApplyHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import mill.define.Applicative.ApplyHandler
import mill.define.Segment.Label
import mill.define._
import mill.eval.{Evaluator, Result}
import pprint.Tree

object ReplApplyHandler {
def apply[T](
Expand Down Expand Up @@ -94,7 +95,7 @@ object ReplApplyHandler {
)
}

def pprintTask(t: NamedTask[_], evaluator: Evaluator) = {
def pprintTask(t: NamedTask[_], evaluator: Evaluator): Tree.Lazy = {
val seen = mutable.Set.empty[Task[_]]
def rec(t: Task[_]): Seq[Segments] = {
if (seen(t)) Nil // do nothing
Expand Down Expand Up @@ -132,7 +133,7 @@ object ReplApplyHandler {
"\n",
ctx.applyPrefixColor("Inputs").toString,
":"
) ++ t.inputs.iterator.flatMap(rec).map("\n " + _.render)
) ++ t.inputs.distinct.iterator.flatMap(rec).map("\n " + _.render)
)
}

Expand Down

0 comments on commit 0337220

Please sign in to comment.