commitin

package
v0.0.0-...-68956d0 Latest Latest
Warning

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

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

Documentation

Overview

Package commitin contains the typed enums and shared types for the `gitmap commit-in` (cin) command. See spec/03-commit-in/.

Enum design (per Core memory rules):

  • Each enum is its own named uint8 type with a String() returning the canonical PascalCase name from constants_commitin.go.
  • Each enum has a single AllX() slice so DB seed code, parity tests, and CLI validators iterate one source of truth.
  • No magic strings — every literal is a constant.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(args []string) (*RawArgs, *ParseError)

Parse converts an argv slice (already stripped of the leading `commit-in` / `cin` token) into a fully-validated RawArgs.

Pure: zero git, zero filesystem, zero DB. Caller layers profile load + interactive prompts on top of the returned RawArgs per spec §5.6.

Error contract: every failure returns a *ParseError carrying the exit code from constants.CommitInExit*. Caller writes `parseErr.Message` to STDERR and exits with `parseErr.ExitCode` — no other side effects happen here.

Types

type CommitOutcome

type CommitOutcome uint8

---- CommitOutcome ------------------------------------------------

const (
	CommitOutcomeCreated CommitOutcome = iota + 1
	CommitOutcomeSkipped
	CommitOutcomeFailed
)

func AllCommitOutcomes

func AllCommitOutcomes() []CommitOutcome

func (CommitOutcome) String

func (o CommitOutcome) String() string

type ConflictMode

type ConflictMode uint8

---- ConflictMode -------------------------------------------------

const (
	ConflictModeForceMerge ConflictMode = iota + 1
	ConflictModePrompt
)

func AllConflictModes

func AllConflictModes() []ConflictMode

func (ConflictMode) String

func (m ConflictMode) String() string

type ExclusionKind

type ExclusionKind uint8

---- ExclusionKind ------------------------------------------------

const (
	ExclusionKindPathFolder ExclusionKind = iota + 1
	ExclusionKindPathFile
)

func AllExclusionKinds

func AllExclusionKinds() []ExclusionKind

func (ExclusionKind) String

func (k ExclusionKind) String() string

type FunctionIntelLanguage

type FunctionIntelLanguage uint8

---- FunctionIntelLanguage ----------------------------------------

const (
	LanguageGo FunctionIntelLanguage = iota + 1
	LanguageJavaScript
	LanguageTypeScript
	LanguageRust
	LanguagePython
	LanguagePhp
	LanguageJava
	LanguageCSharp
)

func AllLanguages

func AllLanguages() []FunctionIntelLanguage

func (FunctionIntelLanguage) String

func (l FunctionIntelLanguage) String() string

type InputKind

type InputKind uint8

---- InputKind ----------------------------------------------------

const (
	InputKindLocalFolder InputKind = iota + 1
	InputKindGitUrl
	InputKindVersionedSibling
)

func AllInputKinds

func AllInputKinds() []InputKind

func (InputKind) String

func (k InputKind) String() string

type MessageRuleArg

type MessageRuleArg struct {
	Kind  string
	Value string
}

MessageRuleArg is the parsed shape of one `--message-exclude` entry. `Kind` is one of the MessageRuleKind enum literals.

type MessageRuleKind

type MessageRuleKind uint8

---- MessageRuleKind ----------------------------------------------

const (
	MessageRuleKindStartsWith MessageRuleKind = iota + 1
	MessageRuleKindEndsWith
	MessageRuleKindContains
)

func AllMessageRuleKinds

func AllMessageRuleKinds() []MessageRuleKind

func (MessageRuleKind) String

func (k MessageRuleKind) String() string

type ParseError

type ParseError struct {
	ExitCode int
	Message  string
}

ParseError carries the exit code that the caller should propagate to `os.Exit` along with a stderr-ready message. Per zero-swallow rule, every error path through the parser returns exactly one ParseError.

func (*ParseError) Error

func (e *ParseError) Error() string

type RawArgs

type RawArgs struct {
	Source string   // <source> argv token, verbatim
	Inputs []string // expanded input list (post separator/quote split)
	// Keyword captures the special-mode token when present. Empty
	// string when the user passed explicit inputs.
	Keyword     string // "all" | "-N" (verbatim) | ""
	KeywordTail int    // N when Keyword == "-N"; 0 otherwise

	// Behavior flags (defaults match spec §2.5 column "Default").
	UseDefaultProfile    bool
	ProfileName          string
	SaveProfileName      string
	SaveProfileOverwrite bool
	SetDefault           bool

	AuthorName  string
	AuthorEmail string

	ConflictMode  string // ConflictMode enum literal; empty = unset
	Exclude       []string
	MessageRules  []MessageRuleArg
	MessagePrefix []string
	MessageSuffix []string
	TitlePrefix   string
	TitleSuffix   string

	OverrideMessages []string
	OverrideOnlyWeak bool
	WeakWords        []string

	FunctionIntel string   // "on" | "off" | "" (unset)
	Languages     []string // FunctionIntelLanguage literals

	IsNoPrompt        bool
	IsDryRun          bool
	IsKeepTemp        bool
	IsNoReleaseBranch bool // --no-release-branch; default false (branches ON)
}

RawArgs is the in-memory shape of a successful `commit-in` parse. All resolved-but-unresolved-defaults values stay zero so the caller can layer profile + interactive prompts on top per spec §5.6.

Pure value type: zero git, zero filesystem, zero DB. Trivially printable for golden-test diffing.

type RunStatus

type RunStatus uint8

---- RunStatus ----------------------------------------------------

const (
	RunStatusPending RunStatus = iota + 1
	RunStatusRunning
	RunStatusCompleted
	RunStatusFailed
	RunStatusPartiallyFailed
)

func AllRunStatuses

func AllRunStatuses() []RunStatus

func (RunStatus) String

func (s RunStatus) String() string

type SkipReason

type SkipReason uint8

---- SkipReason ---------------------------------------------------

const (
	SkipReasonDuplicateSourceSha SkipReason = iota + 1
	SkipReasonExcludedAllFiles
	SkipReasonEmptyAfterMessageRules
	SkipReasonDryRun
)

func AllSkipReasons

func AllSkipReasons() []SkipReason

func (SkipReason) String

func (r SkipReason) String() string

Directories

Path Synopsis
Package checkpoint persists per-input progress for commit-in so a re-run after a crash or Ctrl-C skips the source SHAs that already produced a Created/Skipped outcome in the previous attempt.
Package checkpoint persists per-input progress for commit-in so a re-run after a crash or Ctrl-C skips the source SHAs that already produced a Created/Skipped outcome in the previous attempt.
Package e2e provides shared fixture builders and run helpers for the commit-in end-to-end test suites (Steps 9–12 of the commit-in implementation plan).
Package e2e provides shared fixture builders and run helpers for the commit-in end-to-end test suites (Steps 9–12 of the commit-in implementation plan).
Package orchestrator wires the commit-in sub-packages together.
Package orchestrator wires the commit-in sub-packages together.

Jump to

Keyboard shortcuts

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