Documentation
¶
Overview ¶
Command mvmlint runs mvm's project-specific source checks over mvm's own Go source, using mvm's own scanner (github.com/mvm-sh/mvm/scan) rather than the Go AST or go/analysis. This keeps the tool dependency-free (no x/tools) and dogfoods the scanner on the whole repository as a side effect.
Usage:
go run ./cmd/mvmlint [dir ...] # default: the whole module
Checks:
symkey - writes to a .Symbols (symbol.SymMap) table must use a key that is
pkg-qualified (pkgKey/QualifyName/...), lexically scoped (a "/"
concat), a predeclared/builtin name, or forwarded from an enclosing
parameter. Bare keys are the root of the cross-package symbol
collision class. Suppress an intentional bare key with a trailing
// mvm:symkey-ok comment.
posbase - PosBase is added by Compiler.emit; re-adding it elsewhere
double-applies the position base. Suppress with // mvm:posbase-ok.
The checks are text/token heuristics, not a type-checked analysis: key classification resolves locals through best-effort reaching definitions that are not block-scoped, so a safe definition in one branch can clear a same-named bare key in a sibling branch (a possible false negative). This is acceptable for a dogfooding guard whose green output is sanity, not proof.
Click to show internal directories.
Click to hide internal directories.