bufbreakingconfig

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesForConfig

func BytesForConfig(config *Config) ([]byte, error)

BytesForConfig takes a *Config and returns the deterministic []byte representation. We use an unexported intermediary JSON form and sort all fields to ensure that the bytes associated with the *Config are deterministic.

func ProtoForConfig

func ProtoForConfig(config *Config) *breakingv1.Config

ProtoForConfig takes a *Config and returns the proto representation.

Types

type Config

type Config struct {
	// Use is a list of the rule and/or category IDs that are included in the breaking change check.
	Use []string
	// Except is a list of the rule and/or category IDs that are excluded from the breaking change check.
	Except []string
	// IgnoreRootPaths is a list of the paths of directories and/or files that should be ignored by the breaking change check.
	// All paths are relative to the root of the module.
	IgnoreRootPaths []string
	// IgnoreIDOrCategoryToRootPaths is a map of rule and/or category IDs to directory and/or file paths to exclude from the
	// breaking change check.
	IgnoreIDOrCategoryToRootPaths map[string][]string
	// IgnoreUnstablePackages ignores packages with a last component that is one of the unstable forms recognised
	// by the PACKAGE_VERSION_SUFFIX:
	//   v\d+test.*
	//   v\d+(alpha|beta)\d+
	//   v\d+p\d+(alpha|beta)\d+
	IgnoreUnstablePackages bool
	// Version represents the version of the breaking change rule and category IDs that should be used with this config.
	Version string
}

Config is the breaking check config.

func ConfigForProto

func ConfigForProto(protoConfig *breakingv1.Config) *Config

ConfigForProto returns the Config given the proto.

func NewConfigV1

func NewConfigV1(externalConfig ExternalConfigV1) *Config

NewConfigV1 returns a new Config.

func NewConfigV1Beta1

func NewConfigV1Beta1(externalConfig ExternalConfigV1Beta1) *Config

NewConfigV1Beta1 returns a new Config.

type ExternalConfigV1

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.

func ExternalConfigV1ForConfig

func ExternalConfigV1ForConfig(config *Config) ExternalConfigV1

ExternalConfigV1ForConfig takes a *Config and returns the v1 external config representation.

type ExternalConfigV1Beta1

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.

func ExternalConfigV1Beta1ForConfig

func ExternalConfigV1Beta1ForConfig(config *Config) ExternalConfigV1Beta1

ExternalConfigV1Beta1ForConfig takes a *Config and returns the v1beta1 external config representation.

Jump to

Keyboard shortcuts

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