Versions in this module Expand all Collapse all v0 v0.0.2 Apr 15, 2024 Changes in this version + func AllCategoriesAndIDsForVersionSpec(versionSpec *VersionSpec) []string + func AllCategoriesForVersionSpec(versionSpec *VersionSpec) []string + func AllIDsForVersionSpec(versionSpec *VersionSpec) []string + type CheckFunc func(id string, ignoreFunc IgnoreFunc, previousFiles []protosource.File, ...) ([]bufanalysis.FileAnnotation, error) + type Config struct + AllowCommentIgnores bool + IgnoreIDToRootPaths map[string]map[string]struct{} + IgnoreRootPaths map[string]struct{} + IgnoreUnstablePackages bool + Rules []*Rule + type ConfigBuilder struct + AllowCommentIgnores bool + EnumZeroValueSuffix string + Except []string + IgnoreIDOrCategoryToRootPaths map[string][]string + IgnoreRootPaths []string + IgnoreUnstablePackages bool + RPCAllowGoogleProtobufEmptyRequests bool + RPCAllowGoogleProtobufEmptyResponses bool + RPCAllowSameRequestResponse bool + ServiceSuffix string + Use []string + func (b ConfigBuilder) NewConfig(versionSpec *VersionSpec) (*Config, error) + type Helper struct + func NewHelper(id string, ignoreFunc IgnoreFunc) *Helper + func (h *Helper) AddFileAnnotationWithExtraIgnoreDescriptorsf(descriptor protosource.Descriptor, ...) + func (h *Helper) AddFileAnnotationWithExtraIgnoreLocationsf(descriptor protosource.Descriptor, location protosource.Location, ...) + func (h *Helper) AddFileAnnotationf(descriptor protosource.Descriptor, location protosource.Location, ...) + func (h *Helper) FileAnnotations() []bufanalysis.FileAnnotation + type IgnoreFunc func(id string, descriptors []protosource.Descriptor, ...) bool + type Rule struct + func (c *Rule) Categories() []string + func (c *Rule) ID() string + func (c *Rule) MarshalJSON() ([]byte, error) + func (c *Rule) Purpose() string + type RuleBuilder struct + func NewNopRuleBuilder(id string, purpose string, checkFunc CheckFunc) *RuleBuilder + func NewRuleBuilder(id string, newPurpose func(ConfigBuilder) (string, error), ...) *RuleBuilder + func (c *RuleBuilder) ID() string + func (c *RuleBuilder) NewRule(configBuilder ConfigBuilder, categories []string) (*Rule, error) + type Runner struct + func NewRunner(logger *zap.Logger, options ...RunnerOption) *Runner + func (r *Runner) Check(ctx context.Context, config *Config, previousFiles []protosource.File, ...) ([]bufanalysis.FileAnnotation, error) + type RunnerOption func(*Runner) + func RunnerWithIgnorePrefix(ignorePrefix string) RunnerOption + type VersionSpec struct + DefaultCategories []string + IDToCategories map[string][]string + RuleBuilders []*RuleBuilder