Documentation
¶
Overview ¶
SPDX-License-Identifier: Apache-2.0
Copyright © 2020- Leonardo Di Donato <leodidonato@gmail.com>
SPDX-License-Identifier: Apache-2.0
Copyright © 2020- Leonardo Di Donato <leodidonato@gmail.com>
Index ¶
- type BestEfforter
- type ConventionalCommit
- func (c *ConventionalCommit) HasFooter() bool
- func (c *ConventionalCommit) IsBreakingChange() bool
- func (c *ConventionalCommit) IsFeat() bool
- func (c *ConventionalCommit) IsFix() bool
- func (c *ConventionalCommit) Ok() bool
- func (c *ConventionalCommit) VersionBump(strategy VersionBumpStrategy) VersionBump
- type Logger
- type Machine
- type MachineOption
- type Message
- type TypeConfig
- type TypeConfigurer
- type VersionBump
- type VersionBumpStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BestEfforter ¶
type BestEfforter interface {
WithBestEffort()
HasBestEffort() bool
}
BestEfforter is an interface that wraps the methods about the best effort mode.
type ConventionalCommit ¶
type ConventionalCommit struct {
Type string
Description string
Scope *string // optional
Exclamation bool
Body *string // optional
TypeConfig TypeConfig
}
ConventionalCommit represents a commit message as per Conventional Commits specification.
func (*ConventionalCommit) HasFooter ¶
func (c *ConventionalCommit) HasFooter() bool
HasFooter tells whether the receiving commit message struct has one or more trailers.
func (*ConventionalCommit) IsBreakingChange ¶
func (c *ConventionalCommit) IsBreakingChange() bool
IsBreakingChange tells whether the receiving commit message struct represents a breaking change or not.
func (*ConventionalCommit) IsFeat ¶ added in v0.11.0
func (c *ConventionalCommit) IsFeat() bool
IsFeat tells whether the receiving commit message struct represents a feat change or not.
func (*ConventionalCommit) IsFix ¶ added in v0.11.0
func (c *ConventionalCommit) IsFix() bool
IsFix tells whether the receiving commit message struct represents a fix change or not.
func (*ConventionalCommit) Ok ¶
func (c *ConventionalCommit) Ok() bool
Ok tells whether the receiving commit message is well-formed or not.
A minimally well-formed commit message has at least a valid type and a non empty description.
func (*ConventionalCommit) VersionBump ¶ added in v0.11.0
func (c *ConventionalCommit) VersionBump(strategy VersionBumpStrategy) VersionBump
VersionBump tells which version bump the receiving commit message mandates.
type Machine ¶
type Machine interface {
Parse(input []byte) (Message, error)
BestEfforter
TypeConfigurer
Logger
}
Machine represent a FSM able to parse a conventional commit and return it in an structured way.
type MachineOption ¶
MachineOption represents the type of option setters for Machine instances.
type Message ¶
type Message interface {
Ok() bool
IsBreakingChange() bool
IsFeat() bool
IsFix() bool
VersionBump(VersionBumpStrategy) VersionBump
}
Message represent a conventional commit message.
type TypeConfig ¶
type TypeConfig int
TypeConfig represent the set of types the parser should use.
const ( // TypesMinimal is the minimal set of types. TypesMinimal TypeConfig = iota // TypesConventional represents the conventional set of types. // See https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional TypesConventional // TypesFalco represents the set of types that Falco uses for its release notes. // See https://github.com/falcosecurity/falco TypesFalco // TypesFreeForm represents a free-form set of types. TypesFreeForm )
type TypeConfigurer ¶
type TypeConfigurer interface {
WithTypes(t TypeConfig)
}
TypeConfigurer represents parsers with the option to enable different commit message types.
type VersionBump ¶ added in v0.11.0
type VersionBump int
VersionBump represent the set of possible version bumps a commit can mandate.
const ( UnknownVersion VersionBump = iota PatchVersion MinorVersion MajorVersion )
func DefaultStrategy ¶ added in v0.11.0
func DefaultStrategy(c *ConventionalCommit) VersionBump
DefaultStrategy is a basic, opiniated strategy to evaluate the version bump.
type VersionBumpStrategy ¶ added in v0.11.0
type VersionBumpStrategy func(*ConventionalCommit) VersionBump
VersionBumpStrategy represents a strategy how to evaluate the version bump depending on the TypeConfig initially used and the commits type.
Directories
¶
| Path | Synopsis |
|---|---|
|
SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0 |
|
SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0 |
|
tools
|
|
|
removecomments
command
SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0 |
|
snake2camel
command
SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0 |