buflint

package
v1.0.0-rc12 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 14 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 GetAllRulesAndCategoriesV1

func GetAllRulesAndCategoriesV1() []string

GetAllRulesAndCategoriesV1 returns all rules and categories for v1 as a string slice.

This is used for validation purposes only.

func GetAllRulesAndCategoriesV1Beta1

func GetAllRulesAndCategoriesV1Beta1() []string

GetAllRulesAndCategoriesV1Beta1 returns all rules and categories for v1beta1 as a string slice.

This is used for validation purposes only.

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 RulesForConfig

func RulesForConfig(config *buflintconfig.Config) ([]bufcheck.Rule, error)

RulesForConfig returns the rules for a given config.

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 be filtered with regards to imports before passing to this function.
	Check(
		ctx context.Context,
		config *buflintconfig.Config,
		image bufimage.Image,
	) ([]bufanalysis.FileAnnotation, error)
}

Handler handles the main lint functionality.

func NewHandler

func NewHandler(logger *zap.Logger) 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.

Jump to

Keyboard shortcuts

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