1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-29 22:28:23 +02:00

refactor: tiny refactoring on friendly, sarif and stylish formatters (#1355)

* refactor: replace function call by var ref and move def near utilization in friendly and stylish formatters

* refactor: makes reduces visibility of Sarif.AddResult function by renaming it as addResult

* fix: stylish formatter doesn't handle singular/plural in the synthesis message
This commit is contained in:
chavacava
2025-05-18 10:52:49 +02:00
committed by GitHub
parent f3f77bb387
commit e16f5aa5a6
4 changed files with 26 additions and 22 deletions

View File

@@ -27,7 +27,7 @@ func (*Sarif) Format(failures <-chan lint.Failure, cfg lint.Config) (string, err
sarifLog := newReviveRunLog(cfg)
for failure := range failures {
sarifLog.AddResult(failure)
sarifLog.addResult(failure)
}
buf := new(bytes.Buffer)
@@ -72,7 +72,7 @@ func (l *reviveRunLog) addRules(cfg map[string]lint.RuleConfig) {
}
}
func (l *reviveRunLog) AddResult(failure lint.Failure) {
func (l *reviveRunLog) addResult(failure lint.Failure) {
positiveOrZero := func(x int) int {
if x > 0 {
return x