Skip to content

Commit

Permalink
Enable revive linter (prometheus-community#519)
Browse files Browse the repository at this point in the history
* Bump Go to 1.17
* Bump prometheus orb to 0.15.0
* Enable `revive` linter.
* Fixup linter nits.

Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ authored and Jeff Nadler committed Oct 27, 2022
1 parent 2c9789f commit 64d7712
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
version: 2.1

orbs:
prometheus: prometheus/prometheus@0.11.0
prometheus: prometheus/prometheus@0.15.0

executors:
# This must match .promu.yml.
golang:
docker:
- image: circleci/golang:1.16
- image: circleci/golang:1.17

jobs:
test:
Expand Down
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
linters:
enable:
- revive

issues:
exclude-rules:
- path: _test.go
Expand Down
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
go:
# This must match .circle/config.yml.
version: 1.16
version: 1.17
repository:
path: github.com/prometheus-community/elasticsearch_exporter
build:
Expand Down
6 changes: 3 additions & 3 deletions collector/indices_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestIndicesSettings(t *testing.T) {
// t.Errorf("Wrong setting for cluster routing allocation enabled")
// }
var counter int
var total_fields int
var totalFields int
for key, value := range nsr {
if value.Settings.IndexInfo.Blocks.ReadOnly == "true" {
counter++
Expand All @@ -89,7 +89,7 @@ func TestIndicesSettings(t *testing.T) {
}
}
if value.Settings.IndexInfo.Mapping.TotalFields.Limit == "10000" {
total_fields++
totalFields++
if key != "instagram" {
t.Errorf("Expected 10000 total_fields only for instagram")
}
Expand All @@ -98,7 +98,7 @@ func TestIndicesSettings(t *testing.T) {
if counter != 2 {
t.Errorf("Wrong number of read_only indexes")
}
if total_fields != 1 {
if totalFields != 1 {
t.Errorf(("Wrong number of total_fields found"))
}
}
Expand Down

0 comments on commit 64d7712

Please sign in to comment.