bufbreaking

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package bufbreaking contains the breaking change detection functionality.

The primary entry point to this package is the Handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllCheckers

func GetAllCheckers(categories ...string) ([]bufcheck.Checker, error)

GetAllCheckers gets all known checkers for the given categories.

If categories is empty, this returns all checkers as bufcheck.Checkers.

Should only be used for printing.

Types

type Checker

type Checker interface {
	bufcheck.Checker
	// contains filtered or unexported methods
}

Checker is a checker.

type Config

type Config struct {
	// Checkers are the checkers to run.
	//
	// Checkers will be sorted by first categories, then id when Configs are
	// created from this package, i.e. created wth ConfigBuilder.NewConfig.
	Checkers            []Checker
	IgnoreIDToRootPaths map[string]map[string]struct{}
	IgnoreRootPaths     map[string]struct{}
}

Config is the check config.

func NewConfig added in v0.15.0

func NewConfig(externalConfig ExternalConfig) (*Config, error)

NewConfig returns a new Config.

func (*Config) GetCheckers

func (c *Config) GetCheckers(categories ...string) ([]bufcheck.Checker, error)

GetCheckers returns the checkers for the given categories.

If categories is empty, this returns all checkers as bufcheck.Checkers.

Should only be used for printing.

type ExternalConfig added in v0.17.0

type ExternalConfig struct {
	Use    []string `json:"use,omitempty" yaml:"use,omitempty"`
	Except []string `json:"except,omitempty" yaml:"except,omitempty"`
	// IgnoreRootPaths
	Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"`
	// IgnoreIDOrCategoryToRootPaths
	IgnoreOnly map[string][]string `json:"ignore_only,omitempty" yaml:"ignore_only,omitempty"`
}

ExternalConfig is an external config.

type Handler

type Handler interface {
	// Check runs the breaking checks.
	//
	// The image should have source code info for this to work properly. The previousImage
	// does not need to have source code info.
	//
	// Images should be filtered with regards to imports before passing to this function.
	Check(
		ctx context.Context,
		config *Config,
		previousImage bufcore.Image,
		image bufcore.Image,
	) ([]bufanalysis.FileAnnotation, error)
}

Handler handles the main breaking functionality.

func NewHandler

func NewHandler(logger *zap.Logger) Handler

NewHandler returns a new Handler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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