Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lint ¶
Lint groups repository lint and formatting targets.
func (Lint) Changed ¶
Changed runs go.mod validation, ensures custom-gcl is built (only if stale), then runs the patch-scoped golangci-lint pass against changes from origin/main. Equivalent to the previous `atmos lint changed` chain (gomodcheck -> custom-gcl -> run-custom-golangci-lint.sh).
No dedicated test: this is a one-line composition with no branching logic of its own. Every target it calls (GoModCheck, CustomGCL, Precommit) is unit-tested independently; meaningfully testing Changed itself would mean re-running CustomGCL's real `golangci-lint custom` network fetch + full recompile, which is integration-test territory this package exists to make lazy/cached, not something worth re-running in the unit-test tier.
func (Lint) CustomGCL ¶
CustomGCL builds the custom golangci-lint binary (with the lintroller plugin compiled in) via `golangci-lint custom`, but only when the existing binary is missing or older than its build inputs (.custom-gcl.yml or any tools/lintroller source/module file). Rebuilding unconditionally is the single biggest waste in `lint changed` (golangci-lint custom clones and recompiles a full binary), so this mirrors the previous bash staleness guard exactly.
func (Lint) GoModCheck ¶
GoModCheck verifies go.mod has no replace/exclude directives that would break `go install` for consumers of this module. It runs via `go run` rather than a staleness-cached binary — Go's build cache already makes repeat compiles fast, so the hand-rolled cached-binary staleness check the atmos-command version previously had (mirroring tools/lintroller's) bought little for the extra code, and this now gives the pre-commit hook and `atmos lint gomodcheck` byte-identical behavior for the first time.
func (Lint) Lintroller ¶
Lintroller builds (if stale) and runs the standalone Atmos lintroller analyzer binary against every non-testdata package.
func (Lint) Precommit ¶
Precommit runs golangci-lint (with lintroller) against changed files using the pre-built ./custom-gcl binary.
IMPORTANT: this target must never build ./custom-gcl itself. Building `golangci-lint custom` (a full clone + recompile of golangci-lint) inside a pre-commit hook previously corrupted git worktrees; the fix is that the hook only ever checks for a pre-built binary and fails fast with a helpful message if it's missing. Do not "helpfully" wire CustomGCL in as a dependency here.