buflint

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package buflint contains the linting functionality.

The primary entry point to this package is the Handler.

Index

Constants

This section is empty.

Variables

View Source
var AllFormatStrings = append(
	bufanalysis.AllFormatStrings,
	"config-ignore-yaml",
)

AllFormatStrings are all format strings.

Functions

func GetAllRulesV1

func GetAllRulesV1() ([]bufcheck.Rule, error)

GetAllRulesV1 gets all known rules.

Should only be used for printing.

func GetAllRulesV1Beta1

func GetAllRulesV1Beta1() ([]bufcheck.Rule, error)

GetAllRulesV1Beta1 gets all known rules.

Should only be used for printing.

func GetAllRulesV2 added in v1.32.0

func GetAllRulesV2() ([]bufcheck.Rule, error)

GetAllRulesV2 gets all known rules.

Should only be used for printing.

func GetRelevantDeprecations added in v1.32.0

func GetRelevantDeprecations(fileVersion bufconfig.FileVersion) (map[string][]string, error)

GetRelevantDeprecations gets deprecation information for the given version. The map is from deprecated rule IDs to zero or more replacement rule IDs.

func PrintFileAnnotationSetConfigIgnoreYAMLV1 added in v1.32.0

func PrintFileAnnotationSetConfigIgnoreYAMLV1(
	writer io.Writer,
	fileAnnotationSet bufanalysis.FileAnnotationSet,
) error

PrintFileAnnotationSetConfigIgnoreYAMLV1 prints the FileAnnotationSet to the Writer for the config-ignore-yaml format.

TODO FUTURE: This is messed.

func RulesForConfig

func RulesForConfig(config bufconfig.LintConfig) ([]bufcheck.Rule, error)

RulesForConfig returns the rules for a given config.

Does NOT include deprecated rules.

Should only be used for printing.

Types

type Handler

type Handler interface {
	// Check runs the lint checks.
	//
	// The image should have source code info for this to work properly.
	//
	// Images should *not* be filtered with regards to imports before passing to this function.
	//
	// An error of type bufanalysis.FileAnnotationSet will be returned on breaking failure.
	Check(
		ctx context.Context,
		config bufconfig.LintConfig,
		image bufimage.Image,
	) error
}

Handler handles the main lint functionality.

func NewHandler

func NewHandler(logger *zap.Logger, tracer tracing.Tracer) Handler

NewHandler returns a new Handler.

Directories

Path Synopsis
internal
buflintbuild
Package buflintbuild contains the RuleBuilders used by buflintv*.
Package buflintbuild contains the RuleBuilders used by buflintv*.
buflintcheck
Package buflintcheck impelements the check functions.
Package buflintcheck impelements the check functions.
buflintv1
Package buflintv1 contains the VersionSpec for v1.
Package buflintv1 contains the VersionSpec for v1.
buflintv1beta1
Package buflintv1beta1 contains the VersionSpec for v1beta1.
Package buflintv1beta1 contains the VersionSpec for v1beta1.
buflintv2
Package buflintv2 contains the VersionSpec for v2.
Package buflintv2 contains the VersionSpec for v2.

Jump to

Keyboard shortcuts

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