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 ¶
- type ComputeNewSemverOutput
- type Parser
- func (p *Parser) ComputeNewSemver(repository *git.Repository, project monorepo.Project, branch branch.Branch) (ComputeNewSemverOutput, error)
- func (p *Parser) FetchLatestSemverTag(repository *git.Repository, project monorepo.Project) (*object.Tag, error)
- func (p *Parser) ProcessCommit(commit *object.Commit, latestSemver *semver.Version, project monorepo.Project) (bool, plumbing.Hash, error)
- func (p *Parser) Run(ctx context.Context, repository *git.Repository) ([]ComputeNewSemverOutput, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComputeNewSemverOutput ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx *appcontext.AppContext) *Parser
func (*Parser) ComputeNewSemver ¶
func (p *Parser) ComputeNewSemver(repository *git.Repository, project monorepo.Project, branch branch.Branch) (ComputeNewSemverOutput, error)
ComputeNewSemver returns the next, if any, semantic version number from a given Git repository by parsing its commit history.
func (*Parser) FetchLatestSemverTag ¶
func (p *Parser) FetchLatestSemverTag(repository *git.Repository, project monorepo.Project) (*object.Tag, error)
FetchLatestSemverTag parses a Git repository to fetch the tag corresponding to the highest semantic version number among all tags.
func (*Parser) ProcessCommit ¶
func (p *Parser) ProcessCommit(commit *object.Commit, latestSemver *semver.Version, project monorepo.Project) (bool, plumbing.Hash, error)
ProcessCommit parse a commit message and bump the latest semantic version accordingly.
func (*Parser) Run ¶
func (p *Parser) Run(ctx context.Context, repository *git.Repository) ([]ComputeNewSemverOutput, error)
Run execute a parser on a repository and analyze the given branches and projects contained inside the given AppContext.