commitmsg

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package commitmsg cleans Git commit messages and parses stale-ADR authorization trailers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	Version string
	Reason  string
}

Authorization permits one older authored ADR version for the reason recorded.

func ParseAuthorizations

func ParseAuthorizations(msg Message, validVersion func(string) bool) ([]Authorization, error)

ParseAuthorizations parses the final trailer block and validates reserved pairs.

type Message

type Message struct {
	Text    string
	Subject string
}

Message is a Git-cleaned commit message and its first surviving subject line.

func Clean

func Clean(raw []byte) Message

Clean applies Git's default strip cleanup and returns the recorded message.

type SyntaxError

type SyntaxError struct {
	Line   int
	Reason string
}

SyntaxError identifies malformed reserved authorization syntax by cleaned line.

func (*SyntaxError) Error

func (e *SyntaxError) Error() string

Jump to

Keyboard shortcuts

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