Improve linting (#861)
* Disable unused-parameter check due to false positives on Collect() calls. * Enable misspell. * Simplify error returns. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
parent
6b56e2f057
commit
5f917ccdd9
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
linters:
|
||||
enable:
|
||||
- misspell
|
||||
- revive
|
||||
|
||||
issues:
|
||||
|
@ -14,3 +15,9 @@ linters-settings:
|
|||
exclude-functions:
|
||||
# Never check for logger errors.
|
||||
- (github.com/go-kit/log.Logger).Log
|
||||
revive:
|
||||
rules:
|
||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
|
||||
- name: unused-parameter
|
||||
severity: warning
|
||||
disabled: true
|
||||
|
|
|
@ -115,10 +115,7 @@ func (c PGDatabaseCollector) Update(ctx context.Context, instance *instance, ch
|
|||
prometheus.GaugeValue, sizeMetric, datname,
|
||||
)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return rows.Err()
|
||||
}
|
||||
|
||||
func sliceContains(slice []string, s string) bool {
|
||||
|
|
|
@ -126,8 +126,5 @@ func (PGReplicationSlotCollector) Update(ctx context.Context, instance *instance
|
|||
prometheus.GaugeValue, isActiveValue, slotNameLabel,
|
||||
)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return rows.Err()
|
||||
}
|
||||
|
|
|
@ -218,8 +218,5 @@ func (PGStatIOUserTablesCollector) Update(ctx context.Context, instance *instanc
|
|||
datnameLabel, schemanameLabel, relnameLabel,
|
||||
)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return rows.Err()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue