Documentation
¶
Overview ¶
Command binaryfile checks that no binary file is tracked in the repository.
The build is Bazel-driven and every artifact it produces lands in an ignored directory — bazel-bin/, bin/, or .docker-bin/ — so a tracked binary is always a mistake. The usual cause is an ad-hoc `go build ./service/...` run from the repo root: it names its executable after the package directory and writes it to the working directory, where a broad `git add` sweeps it up.
Checking rather than ignoring is deliberate. A .gitignore entry would stop the file being committed but would also stop git mentioning it at all, so the mistake becomes invisible and the stray artifact simply accumulates. A check that fails names the file and says what to do instead.
Detection follows git's own heuristic: a file is binary if a NUL byte appears in its leading bytes.