mvmlint

command
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

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.

Jump to

Keyboard shortcuts

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