parser

package
v2.2.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package parser provides functions to parse a Git repository commit history.

This package is used to compute the semantic version number from a formatted Git repository commit history. To do so, it expects the commit history to follow the Conventional Commits specification.

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
}

func New

func New(logger zerolog.Logger, releaseRules *rules.ReleaseRules) *Parser

func (*Parser) ComputeNewSemver

func (p *Parser) ComputeNewSemver(r *git.Repository) (*semver.Semver, bool, error)

ComputeNewSemver returns the next, if any, semantic version number from a given Git repository by parsing its commit history.

func (*Parser) ParseHistory

func (p *Parser) ParseHistory(commits []*object.Commit, latestSemver *semver.Semver) (bool, error)

ParseHistory parses a slice of commits and modifies the given semantic version number according to the release rules provided.

Jump to

Keyboard shortcuts

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