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

Function applyCaseArg

rule/case_rules.go:29–37  ·  view source on GitHub ↗
(dst *string, ruleName string, setting lint.RuleSetting)

Source from the content-addressed store, hash-verified

27}
28
29func applyCaseArg(dst *string, ruleName string, setting lint.RuleSetting) error {
30 if err := setStringArg(dst, setting.Argument); err != nil {
31 return errInvalidArg(ruleName, err)
32 }
33 if slices.Contains(casing.All, *dst) {
34 return nil
35 }
36 return errInvalidArg(ruleName, fmt.Errorf("unknown case %q, valid values: %v", *dst, casing.All))
37}
38
39// TypeCaseRule validates that commit type matches a given case format.
40// Argument: one of the casing.* constants (e.g. casing.Lower).

Callers 5

ApplyMethod · 0.85
ApplyMethod · 0.85
ApplyMethod · 0.85
ApplyMethod · 0.85
ApplyMethod · 0.85

Calls 2

setStringArgFunction · 0.85
errInvalidArgFunction · 0.85

Tested by

no test coverage detected