binaryfile

command
v0.3.0-20260820034428-... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL