gitcc

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package gitcc provides the core functionality for gitcc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MessageToDescription

func MessageToDescription(message string) string

MessageToDescription extracts the description part of a commit message.

func MessageToSummary

func MessageToSummary(message string) string

MessageToSummary extracts the summary part of a commit message.

func SplitCommitMessage

func SplitCommitMessage(message string) (summary string, description string)

SplitCommitMessage splits a commit message into summary and description parts.

Types

type Result

type Result struct {
	Status  Status
	Message string
	Commit  *object.Commit
}

Result represents the result of a validation.

func (*Result) String

func (res *Result) String() string

type Status

type Status string

Status represents the validation status of a commit.

const (
	// Invalid indicates that the commit message is invalid.
	Invalid Status = "Invalid"
	// Valid indicates that the commit message is valid.
	Valid Status = "OK"
	// Warning indicates that the commit message is valid, but does not meet the criteria completely.
	Warning Status = "Warning"
)

func (Status) Severity

func (s Status) Severity() int

Severity returns an integer representing the severity of the status, where higher values indicate more severe issues. This is used to sort.

type Validator

type Validator interface {
	Validate(commit *object.Commit) Result
}

Validator defines the interface for validating commit messages. SetOptions is called once before any validation.

type ValidatorConstructor

type ValidatorConstructor func(options map[string]string) (Validator, error)

ValidatorConstructor is a function type that constructs a new Validator with the given options.

Directories

Path Synopsis
Package cli provides the commandline interface for gitcc.
Package cli provides the commandline interface for gitcc.
Package internal contains internal utilities for gitcc.
Package internal contains internal utilities for gitcc.
Package validators provides functionality for managing and compiling custom validators for commit messages.
Package validators provides functionality for managing and compiling custom validators for commit messages.
regex
Package regex provides a validator that checks if the commit message summary and description match specified regular expressions.
Package regex provides a validator that checks if the commit message summary and description match specified regular expressions.
simpletag
Package simpletag implements a simple tag validator.
Package simpletag implements a simple tag validator.

Jump to

Keyboard shortcuts

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