MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / Rule

Interface Rule

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

Rule represent a linter rule

Source from the content-addressed store, hash-verified

55
56// Rule represent a linter rule
57type Rule interface {
58 // Name returns name of the rule, it should be a unique identifier
59 Name() string
60
61 // Apply calls with arguments and flags for the rule from config file
62 // if flags or arguments are invalid or not expected return an error
63 // Apply is called before Validate
64 Apply(setting RuleSetting) error
65
66 // Validate validates the rule for given commit message
67 // if given commit is valid, return true and messages slice are ignored
68 // if invalid, return a error messages with false
69 Validate(msg Commit) (issue *Issue, isValid bool)
70}

Callers 11

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

TypeCaseRulerule/case_rules.go
ScopeCaseRulerule/case_rules.go
DescriptionCaseRulerule/case_rules.go
BodyCaseRulerule/case_rules.go
HeaderCaseRulerule/case_rules.go
BodyLeadingBlankRulerule/leading_blank_rules.go
FooterLeadingBlankRulerule/leading_blank_rules.go
TypeCharsetRulerule/charset_rules.go
ScopeCharsetRulerule/charset_rules.go
ScopeEnumRulerule/scope_enum.go
BreakingChangeExclamationMarkRulerule/breaking_change_rule.go
FooterTypeEnumRulerule/footer_type_enum.go

Calls

no outgoing calls

Tested by

no test coverage detected