Skip to content

glacier lint

Synopsis. Run gofmt, go vet, staticcheck (when on PATH), and six Glacier-specific lints.

Other commands: vibe version generate test init new completions explain

Flags

FlagDefaultDescription
[patterns]./...go/packages patterns to scan.
--fixfalseApply auto-fixable lint fixes in place (gofmt, no-em-dash, marker normalization).
--severitywarningMinimum severity to report and gate on. Values: error, warning, info.
--formattextOutput format. Values: text, json, sarif.
--no-cachefalseIgnore the per-file content-hash cache (.glacier/lint-cache.json).

Examples

Run the full lint suite:

sh
glacier lint

Auto-fix gofmt violations and em-dash characters in one pass:

sh
glacier lint --fix

Report only errors (skip warnings):

sh
glacier lint --severity=error

Emit SARIF for upload to GitHub Code Scanning:

sh
glacier lint --format=sarif > lint.sarif

Lint a single package and show JSON output:

sh
glacier lint ./cli/... --format=json

Glacier-specific lints

RuleSeverityWhat it checks
no-em-dasherrorNo U+2014 in .go, .md, or .txt files
panic-in-libraryerrorNo panic( outside _test.go in non-cmd/ packages
library-error-registererrorExported *Error.Error() strings match ^[a-z][^.]*$
exported-doc-commentwarningEvery exported symbol has a doc comment starting with the symbol name
package-example-testwarningEvery non-internal package has at least one Example* function
naked-anywarning (opt-in)Function signatures use named interfaces rather than bare any/interface{}

The naked-any rule is off by default. Enable it via lint.naked_any.enabled = true in the config file.

What it does under the hood

lint runs gofmt in-process via go/format, shells out to go vet for each pattern, and optionally shells out to staticcheck when it is found on PATH (skipped silently otherwise). The six Glacier-specific rules run in-process via the Linter interface, walking the file tree with filepath.WalkDir. Results are cached by content hash in .glacier/lint-cache.json; a file that has not changed since the last run reuses its cached findings. Findings are grouped by severity (errors first), then by file. --fix rewrites gofmt violations, replaces U+2014 em-dashes with : , and normalizes // +glacier: directive spacing.

Exit codes

CodeMeaning
0No findings at or above the severity threshold
2Bad pattern
65One or more findings at or above the severity threshold
70Subprocess failure (go vet or staticcheck failed to start)

See also

Apache-2.0