fix

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package fix provides fix suggestion generation for API style violations.

Index

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.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns sensible defaults.

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.

func (*RuleFixer) DesignCheck

func (f *RuleFixer) DesignCheck(_ context.Context, resource string, operations []string, _ *Options) (*types.DesignCheck, error)

DesignCheck implements Fixer.

func (*RuleFixer) SuggestFixes

func (f *RuleFixer) SuggestFixes(ctx context.Context, spec []byte, violations []types.Violation, opts *Options) (*types.FixReport, error)

SuggestFixes implements Fixer.

Jump to

Keyboard shortcuts

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