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

Method bySeverity

lint/formatter/default.go:77–89  ·  view source on GitHub ↗

bySeverity returns all messages with given severity

(issues []*lint.Issue)

Source from the content-addressed store, hash-verified

75
76// bySeverity returns all messages with given severity
77func (f *DefaultFormatter) bySeverity(issues []*lint.Issue) (errs, warns, others []*lint.Issue) {
78 for _, r := range issues {
79 switch r.Severity() {
80 case lint.SeverityError:
81 errs = append(errs, r)
82 case lint.SeverityWarn:
83 warns = append(warns, r)
84 default:
85 others = append(others, r)
86 }
87 }
88 return errs, warns, others
89}
90
91func truncate(maxSize int, input string) string {
92 if len(input) < maxSize {

Callers 1

writeFailureMethod · 0.95

Calls 1

SeverityMethod · 0.80

Tested by

no test coverage detected