message

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package message provides helpers for inspecting commit messages.

The package focuses on classifying a commit message by its kind, such as a revert commit or a default commit, so that the linting process can split commits accordingly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser parses a commit message to derive facts about it.

Parser takes the message as-is and answers questions about the commit behind it without modifying it, such as whether the commit is a revert commit.

func NewParser

func NewParser(msg commit.Message) Parser

NewParser creates a new Parser instance for the provided commit message.

func (Parser) IsRevert

func (p Parser) IsRevert() bool

IsRevert reports whether the parsed message belongs to a revert commit.

The commit is a revert commit when the subject starts with "Revert " or when the commit type of the subject equals "revert" case-insensitively.

The parser never reports merge commits, as merge commits are detected by the caller from the commit parents.

Jump to

Keyboard shortcuts

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