Documentation
¶
Overview ¶
Package buflint contains the linting functionality.
The primary entry point to this package is the Handler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Checkers are the lint 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.
type ConfigBuilder ¶
type ConfigBuilder struct {
Use []string
Except []string
IgnoreIDOrCategoryToRootPaths map[string][]string
IgnoreRootPaths []string
EnumZeroValueSuffix string
RPCAllowSameRequestResponse bool
RPCAllowGoogleProtobufEmptyRequests bool
RPCAllowGoogleProtobufEmptyResponses bool
ServiceSuffix string
}
ConfigBuilder is a config builder.
func (ConfigBuilder) NewConfig ¶
func (b ConfigBuilder) NewConfig() (*Config, error)
NewConfig returns a new Config.
type Handler ¶
type Handler interface {
// LintCheck runs the lint checks.
//
// The image should have source code info for this to work properly.
//
// Images should be filtered with regards to imports before passing to this function.
//
// Annotations will use the image file paths, if these should be relative, use
// FixAnnotationFilenames.
LintCheck(
ctx context.Context,
lintConfig *Config,
image *imagev1beta1.Image,
) ([]*analysis.Annotation, error)
}
Handler handles the main lint functionality.
type Runner ¶
type Runner interface {
// Check runs lint checkers, returning a system error if any system error occurs
// or returning the annotations otherwise.
//
// Annotations will be sorted, but Filenames will not have the roots as a prefix, instead
// they will be relative to the roots. This should be fixed for linter outputs if image
// mode is not used.
Check(context.Context, *Config, []protodesc.File) ([]*analysis.Annotation, error)
}
Runner is a runner.
Click to show internal directories.
Click to hide internal directories.