changelog

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotErrCommitsLenZero = fmt.Errorf("commits len is zero")
)

Functions

func AddMarkdownChangelogNodesHead

func AddMarkdownChangelogNodesHead(
	itemNode []sample_mk.Node,
	changelogDesc ConventionalChangeLogDesc,
	logSpec convention.ConventionalChangeLogSpec,
) ([]sample_mk.Node, error)

AddMarkdownChangelogNodesHead add title to markdown nodes

func AddMarkdownChangelogNodesTitle

func AddMarkdownChangelogNodesTitle(
	itemNode []sample_mk.Node,
	gitHttpInfo convention.GitRepositoryHttpInfo,
	changelogDesc ConventionalChangeLogDesc,
	logSpec convention.ConventionalChangeLogSpec,
) ([]sample_mk.Node, error)

AddMarkdownChangelogNodesTitle add title to markdown nodes

func GenerateMarkdownNodes

func GenerateMarkdownNodes(
	gitHttpInfo convention.GitRepositoryHttpInfo,
	commits []convention.Commit,
	logSpec convention.ConventionalChangeLogSpec,
) ([]sample_mk.Node, []sample_mk.Node, error)

GenerateMarkdownNodes

gitHttpInfo: git repo info by convention.GitRepositoryHttpInfo

changelogDesc: changelog desc by ConventionalChangeLogDesc

commit: commit list by []convention.Commit

logSpec: log spec by convention.ConventionalChangeLogSpec

return markdown nodes and feat nodes

func SortCommitsByLogSpec

func SortCommitsByLogSpec(commits map[string][]convention.Commit, logSpec convention.ConventionalChangeLogSpec) (*orderedmap.OrderedMap[string, []convention.Commit], error)

Types

type ConventionalChangeLogDesc

type ConventionalChangeLogDesc struct {
	Version string

	PreviousTag string

	When     time.Time
	Location *time.Location

	ToolsKitName string
	ToolsKitURL  string
}

type Reader

type Reader interface {
	// HistoryFirstTagShort
	// return history first tag short not include convention.ConventionalChangeLogSpec TagPrefix
	HistoryFirstTagShort() string

	// HistoryFirstTag
	// return history first tag this will append convention.ConventionalChangeLogSpec TagPrefix
	HistoryFirstTag() string

	// HistoryFirstTitle
	// return history first title, title not contain ## or ###
	HistoryFirstTitle() string

	// HistoryFirstContent
	// return history first content without title
	HistoryFirstContent() string

	// HistoryFirstChangeUrl
	// return history first change url like https://github.com/convention-change/convention-change-log/compare/v1.0.0...v1.1.0
	HistoryFirstChangeUrl() string

	// HistoryFirstNodes
	// return history first nodes contains title
	HistoryFirstNodes() []sample_mk.Node

	// HistoryNodes
	// full history Nodes
	HistoryNodes() []sample_mk.Node
}

func NewReader

func NewReader(path string, spec convention.ConventionalChangeLogSpec) (Reader, error)

NewReader path: string reader load ChangeLog.md path

spec: convention.ConventionalChangeLogSpec please use convention.DefaultConventionalChangeLogSpec or convention.LoadConventionalChangeLogSpecByData

Jump to

Keyboard shortcuts

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