buf: github.com/bufbuild/buf/internal/buf/bufcheck/bufbreaking Index | Files

package bufbreaking

import "github.com/bufbuild/buf/internal/buf/bufcheck/bufbreaking"

Package bufbreaking contains the breaking change detection functionality.

The primary entry point to this package is the Handler.


Package Files

bufbreaking.go checker.go handler.go

func GetAllCheckersV1Beta1 Uses

func GetAllCheckersV1Beta1() ([]bufcheck.Checker, error)

GetAllCheckersV1Beta1 gets all known checkers.

Should only be used for printing.

type Checker Uses

type Checker interface {
    // contains filtered or unexported methods

Checker is a checker.

type Config Uses

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 NewConfigV1Beta1 Uses

func NewConfigV1Beta1(externalConfig ExternalConfigV1Beta1) (*Config, error)

NewConfigV1Beta1 returns a new Config.

func (*Config) GetCheckers Uses

func (c *Config) GetCheckers() []bufcheck.Checker

GetCheckers returns the checkers.

Should only be used for printing.

type ExternalConfigV1Beta1 Uses

type ExternalConfigV1Beta1 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"`

ExternalConfigV1Beta1 is an external config.

type Handler Uses

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.
        ctx context.Context,
        config *Config,
        previousImage bufimage.Image,
        image bufimage.Image,
    ) ([]bufanalysis.FileAnnotation, error)

Handler handles the main breaking functionality.

func NewHandler Uses

func NewHandler(logger *zap.Logger) Handler

NewHandler returns a new Handler.

Package bufbreaking imports 9 packages (graph) and is imported by 1 packages. Updated 2020-10-20. Refresh now. Tools for package owners.