Documentation
¶
Overview ¶
Package fix provides fix suggestion generation for API style violations.
Index ¶
- type Fixer
- type Options
- type RuleFixer
- func (f *RuleFixer) ConformancePath(_ context.Context, _ []byte, targetLevel string, _ *Options) (*types.ConformancePath, error)
- func (f *RuleFixer) DesignCheck(_ context.Context, resource string, operations []string, _ *Options) (*types.DesignCheck, error)
- func (f *RuleFixer) SuggestFixes(ctx context.Context, spec []byte, violations []types.Violation, opts *Options) (*types.FixReport, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fixer ¶
type Fixer interface {
// SuggestFixes generates fix suggestions for the given violations.
SuggestFixes(ctx context.Context, spec []byte, violations []types.Violation, opts *Options) (*types.FixReport, error)
// DesignCheck provides pre-generation guidance for designing an API resource.
DesignCheck(ctx context.Context, resource string, operations []string, opts *Options) (*types.DesignCheck, error)
// ConformancePath shows the path to reach a conformance level.
ConformancePath(ctx context.Context, spec []byte, targetLevel string, opts *Options) (*types.ConformancePath, error)
}
Fixer generates fix suggestions for violations.
type Options ¶
type Options struct {
// Profile is the style profile to use.
Profile string
// MaxSuggestions limits the number of suggestions returned.
MaxSuggestions int
// IncludePatch generates JSON Patch operations.
IncludePatch bool
// UseLLM enables LLM-based fix generation for complex rules.
UseLLM bool
}
Options configures fix generation.
type RuleFixer ¶
type RuleFixer struct {
// contains filtered or unexported fields
}
RuleFixer generates fixes using rule metadata.
func NewRuleFixer ¶
func NewRuleFixer(profile *types.APIStyleSpec) *RuleFixer
NewRuleFixer creates a fixer from a style profile.
func (*RuleFixer) ConformancePath ¶
func (f *RuleFixer) ConformancePath(_ context.Context, _ []byte, targetLevel string, _ *Options) (*types.ConformancePath, error)
ConformancePath implements Fixer.
Click to show internal directories.
Click to hide internal directories.