Documentation ¶
Index ¶
- Constants
- func ValidateDescription(report *policy.Report, groups []string)
- func ValidateHeaderLength(report *policy.Report, groups []string)
- func ValidateScope(report *policy.Report, groups []string, scopes []string)
- func ValidateType(report *policy.Report, groups []string, types []string)
- type Conventional
Constants ¶
const HeaderRegex = `^(\w*)(\(([^)]+)\))?:\s{1}(.*)($|\n{2})`
HeaderRegex is the regular expression used for Conventional Commits 1.0.0-beta.1.
const MaxNumberOfCommitCharacters = 72
MaxNumberOfCommitCharacters is the maximium number of characters allowed in a commit header.
const TypeFeat = "feat"
TypeFeat is a commit of the type fix patches a bug in your codebase (this correlates with PATCH in semantic versioning).
const TypeFix = "fix"
TypeFix is a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in semantic versioning).
Variables ¶
This section is empty.
Functions ¶
func ValidateDescription ¶
ValidateDescription returns the commit description.
func ValidateHeaderLength ¶
ValidateHeaderLength checks the header length.
func ValidateScope ¶
ValidateScope returns the commit scope.
Types ¶
type Conventional ¶
type Conventional struct { Types []string `mapstructure:"types"` Scopes []string `mapstructure:"scopes"` }
Conventional implements the policy.Policy interface and enforces commit messages to conform the Conventional Commit standard.
func (*Conventional) Compliance ¶
func (c *Conventional) Compliance(metadata *metadata.Metadata, options ...policy.Option) (report policy.Report)
Compliance implements the policy.Policy.Compliance function.