notes

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package notes wraps engine interfaces with common logic unrelated to any particular engine implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildRequest

type BuildRequest struct {
	From      string
	To        string
	ClosedPRs []git.PullRequest
}

BuildRequest is a request for changelog building.

type Builder

type Builder struct {
	Config
	Evaluator *eval.Evaluator
	Extras    map[string]string
	// contains filtered or unexported fields
}

Builder provides methods to form changelog.

func NewBuilder

func NewBuilder(cfg Config, eval *eval.Evaluator, extras map[string]string) (*Builder, error)

NewBuilder creates a new Builder.

func (*Builder) Build

func (s *Builder) Build(ctx context.Context, req BuildRequest) (string, error)

Build builds the changelog for the tag.

type CategoryConfig added in v0.7.0

type CategoryConfig struct {
	Title  string   `yaml:"title"`
	Labels []string `yaml:"labels"`

	// regexp to match source branch name
	Branch string `yaml:"branch"`

	// compiled branch regexp, used internally
	BranchRe *regexp.Regexp `yaml:"-"`
}

CategoryConfig describes the category configuration.

type Config added in v0.7.0

type Config struct {
	// categories to parse in pull requests
	Categories []CategoryConfig `yaml:"categories"`

	// field, by which pull requests must be sorted, in format +|-field
	// currently supported fields: number, author, title, closed
	SortField string `yaml:"sort_field"`
	// template for a changelog.
	Template string `yaml:"template"`

	// if set, the unused category will be built under this title at the
	// end of the changelog
	UnusedTitle string `yaml:"unused_title"`
	// labels for pull requests, which won't be in release notes
	IgnoreLabels []string `yaml:"ignore_labels"`
	// regexp for pull request branches, which won't be in release notes
	IgnoreBranch string `yaml:"ignore_branch"`
	// compiled regexp, used internally
	IgnoreBranchRe *regexp.Regexp `yaml:"-"`
}

Config describes the configuration of the changelog builder.

func ConfigFromFile added in v0.7.0

func ConfigFromFile(path string) (Config, error)

ConfigFromFile reads the configuration from the file.

Jump to

Keyboard shortcuts

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