conventionalcommit

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 3 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 conventionalcommit parses and inspects commit messages against the Conventional Commits 1.0.0 grammar. It validates structure only — it does not enforce a type allow-list (that policy decision lives in internal/app.VerifyCommit) and it does not replicate the broader commitlint-style rule catalog (casing, length limits, signed-off-by, etc.) — see ADR-0027's "Explicitly still out of scope" note.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFixupCommit

func IsFixupCommit(message string) bool

IsFixupCommit reports whether message is a git "fixup!"/"squash!" autosquash commit.

func IsMergeCommit

func IsMergeCommit(message string) bool

IsMergeCommit reports whether message is a git-generated merge commit ("Merge branch ...", "Merge pull request ...", "Merge remote-tracking branch ...").

Types

type Commit

type Commit struct {
	Type        string
	Scope       string
	Breaking    bool
	Description string
	Body        string
	Footers     []Footer
}

Commit is the structural result of parsing a conventional-commit message.

func Parse

func Parse(message string) (*Commit, error)

Parse validates message against the Conventional Commits grammar and returns its structural components. It enforces grammar only — callers needing a type allow-list apply that policy themselves (see internal/app.VerifyCommit).

type Footer struct {
	Token string
	Value string
}

Footer is one trailer in a commit message's footer block, e.g. "Acked-by: Alice" or "BREAKING CHANGE: removes the old flag".

Jump to

Keyboard shortcuts

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