Help us shape the future of Go! Take the 2026 Go Developer Survey

lint

package
v0.53.19 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package lint implements `stackkit module lint` (ADR-0027 Decision 3, gates G1+G3): the deterministic module-hygiene checks that gate proposal PRs and tool-update PRs. It operates on an already-extracted cue.ModuleContract so the same rules run from the CLI, from CI, and from the scaffolder's self-check after rendering.

Rules are intentionally derivable from the module CUE alone — no DB, no network — so the gate is reproducible on any checkout at any commit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountBySeverity

func CountBySeverity(findings []Finding) (errors, warnings int)

CountBySeverity returns (errors, warnings).

func HasErrors

func HasErrors(findings []Finding) bool

HasErrors reports whether any finding is error-severity.

Types

type Finding

type Finding struct {
	Module   string   `json:"module"`
	Service  string   `json:"service,omitempty"`
	Code     string   `json:"code"`
	Severity Severity `json:"severity"`
	Message  string   `json:"message"`
}

Finding is a single lint result. Service is empty for module-scoped rules.

func Module

func Module(mc skcue.ModuleContract) []Finding

Module runs every rule against a single extracted module contract and returns findings sorted deterministically (severity, then service, code).

func (Finding) String

func (f Finding) String() string

type Severity

type Severity string

Severity classifies a finding. Errors fail the gate (in strict mode); warnings are advisory.

const (
	// SeverityError marks a hard violation that fails `--strict`.
	SeverityError Severity = "error"
	// SeverityWarn marks an advisory finding that never fails the gate.
	SeverityWarn Severity = "warn"
)

Jump to

Keyboard shortcuts

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