commit

package
v0.0.0-...-f318275 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	// contains filtered or unexported fields
}

Commit manages commit message generation

func NewGenerator

func NewGenerator(cfg *config.Config, llmClient llm.Client, repo *git.Repository) (*Commit, error)

NewGenerator creates a new commit message generator

func (*Commit) ClearManualMessage

func (g *Commit) ClearManualMessage()

func (*Commit) Generate

func (g *Commit) Generate(ctx context.Context) (string, error)

func (*Commit) GetFilesToUpdate

func (g *Commit) GetFilesToUpdate() ([]string, error)

GetFilesToUpdate returns paths of files that will be updated/committed

func (*Commit) GetWorkflowState

func (g *Commit) GetWorkflowState(ctx context.Context) (*WorkflowState, error)

GetWorkflowState provides the current state of the commit workflow

func (*Commit) SetManualMessage

func (g *Commit) SetManualMessage(message string)

func (*Commit) ValidateCommitMessage

func (g *Commit) ValidateCommitMessage(message string) CommitValidationResult

ValidateCommitMessage handles all commit message validation with detailed feedback

type CommitValidationResult

type CommitValidationResult struct {
	Valid   bool
	Message string
}

CommitValidationResult holds the validation state and any error message

type WorkflowState

type WorkflowState struct {
	Message        string   // Generated commit message
	Files          []string // Files to be committed
	HasChanges     bool     // Whether there are changes to commit
	IsMessageValid bool     // Whether the generated message is valid
	RetryCount     int      // Number of generation retries
	LastError      string   // Last error encountered
	CanCommit      bool     // Whether commit is possible
	ManuallyEdited bool     // Whether message was manually edited
}

WorkflowState represents the current state of commit generation

Jump to

Keyboard shortcuts

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