From 3a2be5bac880fcf5bb8c31641c47590b58971448 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Tue, 12 Jul 2022 20:06:11 +0200 Subject: [PATCH] feat: show some stats after a correct submission --- .../kipp/mill/github/dependency/graph/Github.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugin/src/io/kipp/mill/github/dependency/graph/Github.scala b/plugin/src/io/kipp/mill/github/dependency/graph/Github.scala index ad9fd64..2cf0ee9 100644 --- a/plugin/src/io/kipp/mill/github/dependency/graph/Github.scala +++ b/plugin/src/io/kipp/mill/github/dependency/graph/Github.scala @@ -38,7 +38,19 @@ object Github { ) if (result.is2xx) { - ctx.log.info("Correctly submitted your snapshot to GitHub!") + val manifestModules = snapshot.manifests.size + val totalDependencies = + snapshot.manifests.values.foldLeft(0) { (total, manifest) => + total + manifest.resolved.size + } + + ctx.log.info(s"""Correctly submitted your snapshot to GitHub! + | + |Here are some fun stats! + | + |We submitted dependencies for ${manifestModules} modules. + |This was a total of ${totalDependencies} dependencies. + |""") } else if (result.statusCode == 404) { val msg = """Encountered a 404, make sure you have "Dependency Graph" enabled under "Settings -> Code Security and analysis""""