staleref

command
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

staleref classifies the references a renamed organisation's documentation still makes to its old name, and separates them from the ones that are citations of somebody else.

staleref --old go-pkgx --new go-zpkg --upstream pkgxdev DIR...

⛔⛔ A PLAIN GREP CANNOT DO THIS, which is the whole reason the command exists. `go-zpkg` was `go-pkgx`, and its tools were renamed with it (`bk`→`zbk`, `pkgx`→`zpkgx`, `$PKGX_DIR`→`$ZPKG_DIR`) — but the project it forked from is still called pkgx, still lives at pkgx.sh, still publishes `pkgxdev/pantry`, and the documentation cites it on purpose, including to say what it deliberately does NOT copy. Counting every "pkgx" as drift would propose deleting the citations; counting none would leave the dead links. Measured over the twelve repositories of go-zpkg: 901 occurrences, of which 31 name pkgxdev and must stay.

⛔ AND IT DOES NOT REWRITE. `modrename` already rewrites module paths, where the rule is mechanical ("an occurrence directly preceded by '/' is a file path"). Prose has no such rule: whether a sentence is about our tool or theirs is a question about the sentence. So this reports, with the line, and a person decides. What it buys is that nobody has to FIND them.

Three verdicts, and the third is the honest one:

STALE     names our own old identity — an org path, our own old command,
          our own old environment variable
CITATION  names upstream — their org, their domain, their tool as theirs
UNSURE    says the old token with nothing around it to decide by

⛔ An environment variable is checked against the CODE, never renamed on sight: `BREWKIT_TARGET` is still what zbk reads (`cmd/zbk/main.go`), so a document saying `BREWKIT_TARGET` is CORRECT and a document saying `ZBK_TARGET` would be the drift. The rename of a variable is a decision in the code, and documentation follows it rather than leading it.

Jump to

Keyboard shortcuts

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