commitwizard

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package commitwizard implements `heraut commit create` — an interactive wizard that builds a Conventional Commits message and runs git commit. The interactive form lives in form.go (no unit tests, same as internal/scaffold/wizard.go); everything else is unit- or contract-tested.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assemble

func Assemble(a Answers) *conventionalcommit.Commit

Assemble maps collected Answers to a conventional-commit Commit. A breaking change adds "!" to the header; a non-empty breaking description is prepended as a BREAKING CHANGE footer ahead of the user's footers. The subject and breaking description are trimmed so stray whitespace never reaches the commit header or footer.

func Run

func Run(r port.Runner, cfg *config.Config, opts Options) error

Run drives the interactive wizard: TTY check → staging (unless --all or --dry-run) → collect answers → finalize. Returns nil for clean no-ops (cancel/decline/dry-run).

Types

type Answers

type Answers struct {
	Type         string
	Scope        string
	Subject      string
	Body         string
	Breaking     bool
	BreakingDesc string
	Footers      []conventionalcommit.Footer
}

Answers is the data the interactive form collects.

type Options

type Options struct {
	All    bool      // pass -a to git commit (stage tracked modifications)
	DryRun bool      // print the assembled message, do not stage or commit
	Out    io.Writer // command stdout (also used for the TTY check)
}

Options controls a wizard run.

Jump to

Keyboard shortcuts

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