lint

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package lint detects breaking changes between two versions of pbflags proto definitions.

Index

Constants

View Source
const (
	RuleTypeChanged  = "type_changed"
	RuleLayerChanged = "layer_changed"
)

Rule names.

Variables

This section is empty.

Functions

func BuildDescriptors

func BuildDescriptors(protoDir string) ([]byte, error)

BuildDescriptors builds a FileDescriptorSet from the proto files in protoDir (working tree). Returns the serialized bytes.

func BuildDescriptorsFromRef

func BuildDescriptorsFromRef(protoDir, gitRef string) ([]byte, error)

BuildDescriptorsFromRef builds a FileDescriptorSet from the proto files at the given git ref. Extracts the proto directory from the ref into a temp directory, then runs buf build.

func HasProtoChanges

func HasProtoChanges(baseRef, protoDir string) (bool, error)

HasProtoChanges returns true if any .proto files in protoDir differ between the given git ref and the working tree.

Types

type Violation

type Violation struct {
	FlagID   string // e.g., "notifications/1"
	Rule     string // machine-readable rule name
	Message  string // human-readable description
	Guidance string // suggested fix
}

Violation represents a breaking change detected between two versions of flag definitions.

func Check

func Check(base, current []evaluator.FlagDef) []Violation

Check compares base and current flag definitions and returns any breaking change violations. This is a pure function with no I/O.

func (Violation) String

func (v Violation) String() string

String formats the violation for terminal output.

Jump to

Keyboard shortcuts

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