bufcheck

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Overview

Package bufcheck contains the implementations of the lint and breaking change detection rules.

There is a lot of shared logic between the two, and originally they were actually combined into one logical entity (where some checks happened to be linters, and some checks happen to be breaking change detectors), so some of this is historical.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintRules

func PrintRules(writer io.Writer, rules []Rule, options ...PrintRulesOption) (retErr error)

PrintRules prints the rules to the writer.

Types

type PrintRulesOption added in v1.37.0

type PrintRulesOption func(*printRulesOptions)

PrintRulesOption is an option for PrintRules.

func PrintRulesWithDeprecated added in v1.37.0

func PrintRulesWithDeprecated() PrintRulesOption

PrintRulesWithDeprecated returns a new PrintRulesOption that resullts in deprecated rules being printed.

func PrintRulesWithJSON added in v1.37.0

func PrintRulesWithJSON() PrintRulesOption

PrintRulesWithJSON returns a new PrintRulesOption that says to print the rules as JSON.

The default is to print as text.

type Rule

type Rule interface {
	// ID returns the ID of the Rule.
	//
	// UPPER_SNAKE_CASE.
	ID() string
	// Categories returns the categories of the Rule.
	//
	// UPPER_SNAKE_CASE.
	// Sorted.
	// May be empty.
	Categories() []string
	// Purpose returns the purpose of the Rule.
	//
	// Full sentence.
	Purpose() string

	// Deprecated returns whether or not this rule is deprecated.
	//
	// If it is, it may be replaced by 0 or more rules. These will be denoted with Replacements.
	Deprecated() bool
	// ReplacementIDs returns the IDs of the Rules that replace this Rule.
	//
	// This means that the combination of the Rules specified by ReplacementIDs replace this Rule entirely,
	// and this Rule is considered equivalent to the AND of the rules specified by ReplacementIDs.
	//
	// This will only be non-empty if Deprecated is true.
	//
	// Is it not valid for a Deprecated Rule to specify another Deprecated Rule as a replacement. We verify
	// that this does not happen for any VersionSpec in testing. TODO
	ReplacementIDs() []string
}

Rule is a rule.

Directories

Path Synopsis
Package bufbreaking contains the breaking change detection functionality.
Package bufbreaking contains the breaking change detection functionality.
internal/bufbreakingbuild
Package bufbreakingbuild contains the RuleBuilders used by bufbreakingv*.
Package bufbreakingbuild contains the RuleBuilders used by bufbreakingv*.
internal/bufbreakingcheck
Package bufbreakingcheck impelements the check functions.
Package bufbreakingcheck impelements the check functions.
internal/bufbreakingv1
Package bufbreakingv1 contains the VersionSpec for v1.
Package bufbreakingv1 contains the VersionSpec for v1.
internal/bufbreakingv1beta1
Package bufbreakingv1beta1 contains the VersionSpec for v1beta1.
Package bufbreakingv1beta1 contains the VersionSpec for v1beta1.
internal/bufbreakingv2
Package bufbreakingv2 contains the VersionSpec for v2.
Package bufbreakingv2 contains the VersionSpec for v2.
Package buflint contains the linting functionality.
Package buflint contains the linting functionality.
internal/buflintbuild
Package buflintbuild contains the RuleBuilders used by buflintv*.
Package buflintbuild contains the RuleBuilders used by buflintv*.
internal/buflintcheck
Package buflintcheck impelements the check functions.
Package buflintcheck impelements the check functions.
internal/buflintv1
Package buflintv1 contains the VersionSpec for v1.
Package buflintv1 contains the VersionSpec for v1.
internal/buflintv1beta1
Package buflintv1beta1 contains the VersionSpec for v1beta1.
Package buflintv1beta1 contains the VersionSpec for v1beta1.
internal/buflintv2
Package buflintv2 contains the VersionSpec for v2.
Package buflintv2 contains the VersionSpec for v2.

Jump to

Keyboard shortcuts

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