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

Method formatIssue

formatter/json.go:31–49  ·  view source on GitHub ↗
(issues []*lint.Issue)

Source from the content-addressed store, hash-verified

29}
30
31func (f *JSONFormatter) formatIssue(issues []*lint.Issue) []interface{} {
32 formattedIssues := make([]interface{}, 0, len(issues))
33
34 for _, issue := range issues {
35 output := make(map[string]interface{})
36
37 output["name"] = issue.RuleName()
38 output["severity"] = issue.Severity()
39 output["description"] = issue.Description()
40
41 if len(issue.Infos()) > 0 {
42 output["infos"] = issue.Infos()
43 }
44
45 formattedIssues = append(formattedIssues, output)
46 }
47
48 return formattedIssues
49}

Callers 1

FormatMethod · 0.95

Calls 4

RuleNameMethod · 0.80
SeverityMethod · 0.80
InfosMethod · 0.80
DescriptionMethod · 0.65

Tested by

no test coverage detected