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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user