cmd

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: Apache-2.0 Imports: 36 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// DefaultConfigFileName is the default name for the breaking rules config file
	DefaultConfigFileName = "changes-rules.yaml"
)

Variables

View Source
var (
	Version string
	Commit  string
	Date    string
)

Functions

func ApplyBreakingRulesConfig added in v0.0.91

func ApplyBreakingRulesConfig(config *model.BreakingRulesConfig)

ApplyBreakingRulesConfig sets the active breaking rules config in libopenapi. Thread-safe — delegates to internal/breakingrules which guards with a mutex.

func Execute

func Execute(version, commit, date string)

func ExtractGithubDetailsFromURL

func ExtractGithubDetailsFromURL(specURL *url.URL) (string, string, string, error)

func FlattenReport added in v0.0.54

func FlattenReport(report *model.Report) *model.FlatReport

func FlattenReportWithParameterNames added in v0.1.0

func FlattenReportWithParameterNames(report *model.Report, parameterNames map[string]string) *model.FlatReport

FlattenReportWithParameterNames flattens a report and normalizes parameter paths using the name map from the changerator (keyed by full parameter JSONPath, e.g., "$.paths['/pets'].get.parameters[0]" → "petId").

func GetConsoleCommand

func GetConsoleCommand() *cobra.Command

func GetHTMLReportCommand

func GetHTMLReportCommand() *cobra.Command

func GetMarkdownReportCommand added in v0.0.84

func GetMarkdownReportCommand() *cobra.Command

func GetReportCommand

func GetReportCommand() *cobra.Command

func GetSummaryCommand

func GetSummaryCommand() *cobra.Command

GetSummaryCommand returns the cobra command for the current summary command.

func LoadBreakingRulesConfig added in v0.0.91

func LoadBreakingRulesConfig(configPath string) (*model.BreakingRulesConfig, error)

LoadBreakingRulesConfig loads a breaking rules configuration from the specified path. If configPath is empty, it searches default locations (current directory, then ~/.config). Returns nil config if no config is found in default locations (uses libopenapi defaults). Returns error if user-specified config path doesn't exist or has invalid YAML.

func PrintConfigError added in v0.0.91

func PrintConfigError(err error, palette terminal.Palette)

PrintConfigError prints a config error with nice formatting using lipgloss (no pterm).

func ResetBreakingRulesConfig added in v0.0.91

func ResetBreakingRulesConfig()

ResetBreakingRulesConfig resets the active breaking rules to libopenapi defaults. Thread-safe — delegates to internal/breakingrules which guards with a mutex.

Types

type ConfigParseError added in v0.0.91

type ConfigParseError struct {
	FilePath string
	Err      error
}

ConfigParseError represents a YAML parsing error with context

func (*ConfigParseError) Error added in v0.0.91

func (e *ConfigParseError) Error() string

func (*ConfigParseError) Unwrap added in v0.0.91

func (e *ConfigParseError) Unwrap() error

type ConfigValidationError added in v0.0.91

type ConfigValidationError struct {
	FilePath string
	Result   *model.ConfigValidationResult
}

ConfigValidationError represents validation errors in the config structure

func (*ConfigValidationError) Error added in v0.0.91

func (e *ConfigValidationError) Error() string

Jump to

Keyboard shortcuts

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