Skip to content
index.ocx.sh

Unused Deps

latest 10.2.0_20261028

Static analysis for Bazel java_library targets that finds unused dependencies and emits the buildozer commands to remove them

Unaffiliated mirror. unused_deps is a project of the Bazel authors; this OCX package republishes upstream release binaries and is not endorsed by them. Upstream: github.com/bazel-contrib/buildtools/tree/main/unused_deps ⁠ (opens in a new tab)

Versions · 70

click = copy identifier · right-click = more
(default)
69 more
+2
+2
+2
+2
+4
+8
+2
+6
+2
+4
+6
+4
+2
+4

README

Unused Deps

unused-deps finds dependencies listed on a Bazel java_library target that the code never actually uses — anyone trying to keep a Java BUILD graph lean, or trim a target's compile-time closure, runs it before pruning deps by hand.

It takes one or more target labels, checks each java_library's declared deps against what its sources actually import, and prints the buildozer commands that would remove the unused ones. It never edits a file itself.

What's included

  • unused-deps — the single static binary. No runtime dependencies.

Usage

unused-deps //pkg:my_java_library

Prints a buildozer 'remove deps ...' line for each dependency the target doesn't need.

unused-deps ships from the same repository and release as buildifier and buildozer — if you need one, the other two are one ocx add away.

Links

Apache-2.0 licensed.

Install

Platforms

Linux amd64arm64
macOS amd64arm64
Windows amd64arm64

Metadata

registry
revision
33999342326a5a8a13ff6cbc81388812136cba1d
owners
@ocx-bot
latest
10.2.0_20261028
tags
70