Skip to content
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

Deduplicate inputs in inspect command output #1558

Merged
merged 2 commits into from
Nov 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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