Documentation ¶
Index ¶
- Variables
- func GroupEntries(c *Changelog) map[string][]*Entry
- func NewTemplate(text string) (*template.Template, error)
- func ParseScope(config Config, value string, force bool) (string, []string, error)
- func PermittedScopesString(config Config, breakAfterItem bool) string
- func PermittedTypesString(config Config) string
- func ValidateType(config Config, typ string) (string, error)
- type Changelog
- type Config
- type ConfigScopes
- type ConfigTypes
- type Entry
- type GitHubMeta
- type GitHubRepository
- type Group
- type OrderedMap
- type RenderTemplate
- type Scope
- type TemplateInputs
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTemplate = template.Must(template.New("markdown").Funcs(funcs).Parse(markdownTemplateText))
Functions ¶
func GroupEntries ¶
GroupEntries takes a changelog and returns a map of entry types to changes.
func ParseScope ¶
ParseScope parses a scope string and returns the scope and its list of subscopes, if any.
No validation on allowed scopes/subscopes is done if "force" is set to true.
func PermittedScopesString ¶
func PermittedTypesString ¶
Types ¶
type Changelog ¶
type Changelog struct { // One or more change entries Entries []*Entry `yaml:"changes,omitempty"` }
type Config ¶
type Config struct { // Types is a map of short types to descriptive names to be used in rendering. Types ConfigTypes `yaml:"types"` // Scopes is a map of valid scopes to subscopes Scopes ConfigScopes `yaml:"scopes"` // GitHubRepository, e.g.: pulumi/go-change GitHubRepository GitHubRepository `yaml:"github,omitempty"` // Template is the template to use for rendering the changelog. Template RenderTemplate `yaml:"template"` }
type ConfigScopes ¶
type ConfigScopes = OrderedMap[string, []string]
type ConfigTypes ¶
type ConfigTypes = OrderedMap[string, string]
type Entry ¶
type Entry struct { // Type is a noun describing the category of change: improvement, fix, and so on. Type string `yaml:"type,omitempty"` // Scope is a noun describing the part of the system improved, such as: cli, codegen, sdk, automation. Subscopes can // be represented with a slash after a scope, as in: cli/about, cli/display, auto/go, codegen/dotnet, sdk/nodejs. Scope Scope `yaml:"scope,omitempty"` // Description is a description of the change. Description string `yaml:"description,omitempty"` // Metadata contains additional, optional data for rendering the changelog, which may be set to override inferred // values. GitHubMeta GitHubMeta `yaml:"github,inline"` }
Entry records a change by its category, the scope of the change, and metadata from GitHub needed to render a changelog.
Follows the conventional commits specification: https://www.conventionalcommits.org/en/v1.0.0/#specification
func (*Entry) Conventional ¶
type GitHubMeta ¶
type GitHubMeta struct { // PullRequestNumbers are the GitHub Pull Requests used to implementing this change, typically a single PR. PullRequestNumbers []int `yaml:"prs,omitempty"` }
type GitHubRepository ¶
func (GitHubRepository) MarshalYAML ¶
func (r GitHubRepository) MarshalYAML() (any, error)
func (GitHubRepository) String ¶
func (r GitHubRepository) String() string
func (*GitHubRepository) UnmarshalYAML ¶
func (r *GitHubRepository) UnmarshalYAML(unmarshal func(any) error) (err error)
type OrderedMap ¶
type OrderedMap[K comparable, V any] struct { Items yaml.MapSlice `yaml:",inline"` }
func (*OrderedMap[K, V]) Get ¶
func (c *OrderedMap[K, V]) Get(key K) (V, bool)
func (*OrderedMap[K, V]) Keys ¶
func (c *OrderedMap[K, V]) Keys() []string
func (*OrderedMap[K, V]) ToMap ¶
func (c *OrderedMap[K, V]) ToMap() map[K]V
func (*OrderedMap[K, V]) UnmarshalYAML ¶
func (c *OrderedMap[K, V]) UnmarshalYAML(unmarshal func(any) error) error
type RenderTemplate ¶
func (*RenderTemplate) UnmarshalYAML ¶
func (t *RenderTemplate) UnmarshalYAML(unmarshal func(any) error) error
type Scope ¶
Structured scope annotation, with YAML marshaling to and from a string.
func (Scope) MarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.