MCPcopy Create free account
hub / github.com/conventionalcommit/commitlint / Rule

Interface Rule

lint/lint.go:44–57  ·  view source on GitHub ↗

Rule represent a linter rule

Source from the content-addressed store, hash-verified

42
43// Rule represent a linter rule
44type Rule interface {
45 // Name returns name of the rule, it should be a unique identifier
46 Name() string
47
48 // Apply calls with arguments and flags for the rule from config file
49 // if flags or arguments are invalid or not expected return an error
50 // Apply is called before Validate
51 Apply(setting RuleSetting) error
52
53 // Validate validates the rule for given commit message
54 // if given commit is valid, return true and messages slice are ignored
55 // if invalid, return a error messages with false
56 Validate(msg Commit) (issue *Issue, isValid bool)
57}

Callers 12

TestRegisterCustomRuleFunction · 0.65
RegisterRuleMethod · 0.65
RegisterFormatterMethod · 0.65
LintMethod · 0.65
runRuleMethod · 0.65
processParamFunction · 0.65
GetEnabledRulesFunction · 0.65
ValidateFunction · 0.65
runRuleMethod · 0.65

Implementers 15

TypeCaseRulelint/rule/case_rules.go
ScopeCaseRulelint/rule/case_rules.go
DescriptionCaseRulelint/rule/case_rules.go
BodyCaseRulelint/rule/case_rules.go
HeaderCaseRulelint/rule/case_rules.go
BodyLeadingBlankRulelint/rule/leading_blank_rules.go
FooterLeadingBlankRulelint/rule/leading_blank_rules.go
TypeCharsetRulelint/rule/charset_rules.go
ScopeCharsetRulelint/rule/charset_rules.go
ScopeEnumRulelint/rule/scope_enum.go
BreakingChangeExclamationMarkRulelint/rule/breaking_change_rule.go
FooterTypeEnumRulelint/rule/footer_type_enum.go

Calls

no outgoing calls

Tested by

no test coverage detected