diff --git a/unused_deps/unused_deps.go b/unused_deps/unused_deps.go index d6699d04b..e0607f814 100644 --- a/unused_deps/unused_deps.go +++ b/unused_deps/unused_deps.go @@ -288,6 +288,8 @@ func printCommands(label string, deps map[string]bool) (anyCommandPrinted bool) if hasRuntimeComment(str) { fmt.Printf("buildozer 'move deps runtime_deps %s' %s\n", str.Value, label) } else { + // add dep's exported dependencies to label before removing dep + fmt.Printf("buildozer \"add deps $(%s query 'labels(exports, %s)' | tr '\\n' ' ')\" %s\n", *buildTool, str.Value, label) fmt.Printf("buildozer 'remove deps %s' %s\n", str.Value, label) } anyCommandPrinted = true