Documentation
¶
Overview ¶
Package commitlint provides a simple linter for conventional commits
Index ¶
- Constants
- func CommitMsgHook() string
- func DefaultConfToFile(confPath string) error
- func StreamCommitMsgHook(qw422016 *qt422016.Writer)
- func WriteCommitMsgHook(qq422016 qtio422016.Writer)
- func WriteConfToFile(confPath string, conf *Config) (retErr error)
- type Body
- type Config
- type EnumConf
- type Footer
- type Header
- type IntConf
- type Linter
- type Result
Constants ¶
View Source
const ( WarnType = "warn" ErrorType = "error" )
Rule Type Constants
Variables ¶
This section is empty.
Functions ¶
func CommitMsgHook ¶
func CommitMsgHook() string
func DefaultConfToFile ¶
DefaultConfToFile writes default config to given file
func StreamCommitMsgHook ¶
func WriteCommitMsgHook ¶
func WriteCommitMsgHook(qq422016 qtio422016.Writer)
func WriteConfToFile ¶
WriteConfToFile util func to write config object to given file
Types ¶
type Body ¶
type Body struct {
CanBeEmpty bool `yaml:"can-be-empty"`
MaxLineLength IntConf `yaml:"max-line-length"`
}
Body contains rules for Body in commit message
type EnumConf ¶
type EnumConf struct {
Enabled bool `yaml:"enabled"`
Type string `yaml:"type"`
Value []string `yaml:"value"`
}
EnumConf represent enums config
type Header ¶
type Header struct {
MinLength IntConf `yaml:"min-length"`
MaxLength IntConf `yaml:"max-length"`
Types EnumConf `yaml:"types"`
Scopes EnumConf `yaml:"scopes"`
}
Header contains rules for Header in commit message
type IntConf ¶
type IntConf struct {
Enabled bool `yaml:"enabled"`
Type string `yaml:"type"`
Value int `yaml:"value"`
}
IntConf represent int config
type Linter ¶
type Linter struct {
// contains filtered or unexported fields
}
Linter is a simple linter for conventional commits
func NewDefaultLinter ¶
func NewDefaultLinter() *Linter
NewDefaultLinter returns Linter with default config
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result holds the linter error and warning messages for each rule checked
Click to show internal directories.
Click to hide internal directories.