spec

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SelectionNone does not select any changes.
	SelectionNone = Selection("none")
	// SelectionAll selects all changes.
	SelectionAll = Selection("all")
	// SelectionLabeled selects only those changes that have are labeled.
	SelectionLabeled = Selection("labeled")
)
View Source
const (
	// GroupingSimple groups changes in simple lists.
	GroupingSimple = Grouping("simple")
	// GroupingMilestone groups changes by milestones.
	GroupingMilestone = Grouping("milestone")
	// GroupingLabel groups changes by labels.
	GroupingLabel = Grouping("label")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	ReleaseURL string `yaml:"release-url" flag:"release-url"`
}

Content has the specifications for the content of changelogs.

func (Content) GetReleaseURL

func (c Content) GetReleaseURL(tag string) string

GetReleaseURL returns the actual release url for a tag/release.

type General

type General struct {
	File    string `yaml:"file" flag:"file"`
	Base    string `yaml:"base" flag:"base"`
	Print   bool   `yaml:"print" flag:"print"`
	Verbose bool   `yaml:"verbose" flag:"verbose"`
}

General has the general specifications.

type Grouping

type Grouping string

Grouping determnies how changes are grouped together.

type Issues

type Issues struct {
	Selection         Selection `yaml:"selection" flag:"issues-selection"`
	IncludeLabels     []string  `yaml:"include-labels" flag:"issues-include-labels"`
	ExcludeLabels     []string  `yaml:"exclude-labels" flag:"issues-exclude-labels"`
	Grouping          Grouping  `yaml:"grouping" flag:"issues-grouping"`
	SummaryLabels     []string  `yaml:"summary-labels" flag:"issues-summary-labels"`
	RemovedLabels     []string  `yaml:"removed-labels" flag:"issues-removed-labels"`
	BreakingLabels    []string  `yaml:"breaking-labels" flag:"issues-breaking-labels"`
	DeprecatedLabels  []string  `yaml:"deprecated-labels" flag:"issues-deprecated-labels"`
	FeatureLabels     []string  `yaml:"feature-labels" flag:"issues-feature-labels"`
	EnhancementLabels []string  `yaml:"enhancement-labels" flag:"issues-enhancement-labels"`
	BugLabels         []string  `yaml:"bug-labels" flag:"issues-bug-labels"`
	SecurityLabels    []string  `yaml:"security-labels" flag:"issues-security-labels"`
}

Issues has the specifications for fetching, flitering, and grouping issues.

func (Issues) LabelGroups

func (i Issues) LabelGroups() []LabelGroup

LabelGroups returns the label groups for issues.

type LabelGroup

type LabelGroup struct {
	Title  string
	Labels []string
}

LabelGroup represents a group of issues or merges characterized by a set of labels.

type Merges

type Merges struct {
	Selection         Selection `yaml:"selection" flag:"merges-selection"`
	Branch            string    `yaml:"branch" flag:"merges-branch"`
	IncludeLabels     []string  `yaml:"include-labels" flag:"merges-include-labels"`
	ExcludeLabels     []string  `yaml:"exclude-labels" flag:"merges-exclude-labels"`
	Grouping          Grouping  `yaml:"grouping" flag:"merges-grouping"`
	SummaryLabels     []string  `yaml:"summary-labels" flag:"merges-summary-labels"`
	RemovedLabels     []string  `yaml:"removed-labels" flag:"merges-removed-labels"`
	BreakingLabels    []string  `yaml:"breaking-labels" flag:"merges-breaking-labels"`
	DeprecatedLabels  []string  `yaml:"deprecated-labels" flag:"merges-deprecated-labels"`
	FeatureLabels     []string  `yaml:"feature-labels" flag:"merges-feature-labels"`
	EnhancementLabels []string  `yaml:"enhancement-labels" flag:"merges-enhancement-labels"`
	BugLabels         []string  `yaml:"bug-labels" flag:"merges-bug-labels"`
	SecurityLabels    []string  `yaml:"security-labels" flag:"merges-security-labels"`
}

Merges has the specifications for fetching, flitering, and grouping pull/merge requests.

func (Merges) LabelGroups

func (m Merges) LabelGroups() []LabelGroup

LabelGroups returns the label groups for merges.

type Platform

type Platform string

Platform is the platform for managing a Git remote repository.

const (
	// PlatformGitHub represents the GitHub platform.
	PlatformGitHub Platform = "github.com"
	// PlatformGitLab represents the GitLab platform.
	PlatformGitLab Platform = "gitlab.com"
)

type Repo

type Repo struct {
	Platform    Platform `yaml:"-"`
	Path        string   `yaml:"-"`
	AccessToken string   `yaml:"-" flag:"access-token"`
}

Repo has the specifications for a git repository.

type Selection

type Selection string

Selection determines how changes should be selected for a changelog.

type Spec

type Spec struct {
	Help    bool    `yaml:"-" flag:"help"`
	Version bool    `yaml:"-" flag:"version"`
	Repo    Repo    `yaml:"-"`
	General General `yaml:"general"`
	Tags    Tags    `yaml:"tags"`
	Issues  Issues  `yaml:"issues"`
	Merges  Merges  `yaml:"merges"`
	Content Content `yaml:"content"`
}

Spec has all the specifications required for generating a changelog.

func Default

func Default() Spec

Default returns specfications with default values. The default access token will be read from the CHANGELOG_ACCESS_TOKEN environment variable.

func (Spec) FromFile

func (s Spec) FromFile() (Spec, error)

FromFile updates a base spec from a spec file if it exists.

func (Spec) PrintHelp

func (s Spec) PrintHelp() error

PrintHelp prints the help text.

func (Spec) String

func (s Spec) String() string

func (Spec) WithRepo

func (s Spec) WithRepo(domain, path string) Spec

WithRepo sets Repo sepcs and returns a new spec object.

type Tags

type Tags struct {
	From         string   `yaml:"-" flag:"from-tag"`
	To           string   `yaml:"-" flag:"to-tag"`
	Future       string   `yaml:"-" flag:"future-tag"`
	Exclude      []string `yaml:"exclude" flag:"exclude-tags"`
	ExcludeRegex string   `yaml:"exclude-regex" flag:"exclude-tags-regex"`
}

Tags has the specifications for identifying git tags.

Jump to

Keyboard shortcuts

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