bufbreaking

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 10 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 GetAllRulesV1 added in v0.44.0

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

GetAllRulesV1 gets all known rules.

Should only be used for printing.

func GetAllRulesV1Beta1 added in v0.34.0

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

GetAllRulesV1Beta1 gets all known rules.

Should only be used for printing.

Types

type Config

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

Config is the check config.

func NewConfigV1 added in v0.44.0

func NewConfigV1(externalConfig ExternalConfigV1) (*Config, error)

NewConfigV1 returns a new Config.

func NewConfigV1Beta1 added in v0.25.0

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

NewConfigV1Beta1 returns a new Config.

func (*Config) GetRules added in v0.34.0

func (c *Config) GetRules() []bufcheck.Rule

GetRules returns the rules.

Should only be used for printing.

type ExternalConfigV1 added in v0.44.0

type ExternalConfigV1 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"`
	IgnoreUnstablePackages bool                `json:"ignore_unstable_packages,omitempty" yaml:"ignore_unstable_packages,omitempty"`
}

ExternalConfigV1 is an external config.

type ExternalConfigV1Beta1 added in v0.25.0

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"`
	IgnoreUnstablePackages bool                `json:"ignore_unstable_packages,omitempty" yaml:"ignore_unstable_packages,omitempty"`
}

ExternalConfigV1Beta1 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 bufimage.Image,
		image bufimage.Image,
	) ([]bufanalysis.FileAnnotation, error)
}

Handler handles the main breaking functionality.

func NewHandler

func NewHandler(logger *zap.Logger) Handler

NewHandler returns a new Handler.

type Rule added in v0.34.0

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

Rule is a rule.

Directories

Path Synopsis
internal
bufbreakingbuild
Package bufbreakingbuild contains the RuleBuilders used by bufbreakingv*.
Package bufbreakingbuild contains the RuleBuilders used by bufbreakingv*.
bufbreakingcheck
Package bufbreakingcheck impelements the check functions.
Package bufbreakingcheck impelements the check functions.
bufbreakingv1
Package bufbreakingv1 contains the VersionSpec for v1.
Package bufbreakingv1 contains the VersionSpec for v1.
bufbreakingv1beta1
Package bufbreakingv1beta1 contains the VersionSpec for v1beta1.
Package bufbreakingv1beta1 contains the VersionSpec for v1beta1.

Jump to

Keyboard shortcuts

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