Browse Source

Enable misspell check in golangci-lint (#10393)

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
pull/10385/head
Łukasz Mierzwa 3 years ago committed by GitHub
parent
commit
da23c4649a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .golangci.yml
  2. 2
      model/labels/labels_test.go
  3. 2
      tsdb/agent/db_test.go
  4. 2
      tsdb/head_test.go

1
.golangci.yml

@ -13,6 +13,7 @@ linters:
- gofumpt - gofumpt
- goimports - goimports
- revive - revive
- misspell
issues: issues:
exclude-rules: exclude-rules:

2
model/labels/labels_test.go

@ -548,7 +548,7 @@ func TestLabels_Get(t *testing.T) {
// BenchmarkLabels_Get was written to check whether a binary search can improve the performance vs the linear search implementation // BenchmarkLabels_Get was written to check whether a binary search can improve the performance vs the linear search implementation
// The results have shown that binary search would only be better when searching last labels in scenarios with more than 10 labels. // The results have shown that binary search would only be better when searching last labels in scenarios with more than 10 labels.
// In the following list, `old` is the linear search while `new` is the binary search implementaiton (without calling sort.Search, which performs even worse here) // In the following list, `old` is the linear search while `new` is the binary search implementation (without calling sort.Search, which performs even worse here)
// name old time/op new time/op delta // name old time/op new time/op delta
// Labels_Get/with_5_labels/get_first_label 5.12ns ± 0% 14.24ns ± 0% ~ (p=1.000 n=1+1) // Labels_Get/with_5_labels/get_first_label 5.12ns ± 0% 14.24ns ± 0% ~ (p=1.000 n=1+1)
// Labels_Get/with_5_labels/get_middle_label 13.5ns ± 0% 18.5ns ± 0% ~ (p=1.000 n=1+1) // Labels_Get/with_5_labels/get_middle_label 13.5ns ± 0% 18.5ns ± 0% ~ (p=1.000 n=1+1)

2
tsdb/agent/db_test.go

@ -177,7 +177,7 @@ func TestCommit(t *testing.T) {
} }
} }
// Check that the WAL contained the same number of commited series/samples/exemplars. // Check that the WAL contained the same number of committed series/samples/exemplars.
require.Equal(t, numSeries, walSeriesCount, "unexpected number of series") require.Equal(t, numSeries, walSeriesCount, "unexpected number of series")
require.Equal(t, numSeries*numDatapoints, walSamplesCount, "unexpected number of samples") require.Equal(t, numSeries*numDatapoints, walSamplesCount, "unexpected number of samples")
require.Equal(t, numSeries*numDatapoints, walExemplarsCount, "unexpected number of exemplars") require.Equal(t, numSeries*numDatapoints, walExemplarsCount, "unexpected number of exemplars")

2
tsdb/head_test.go

@ -2969,7 +2969,7 @@ func TestSnapshotError(t *testing.T) {
} }
head.tombstones.AddInterval(1, itvs...) head.tombstones.AddInterval(1, itvs...)
// Check existance of data. // Check existence of data.
require.NotNil(t, head.series.getByHash(lbls.Hash(), lbls)) require.NotNil(t, head.series.getByHash(lbls.Hash(), lbls))
tm, err := head.tombstones.Get(1) tm, err := head.tombstones.Get(1)
require.NoError(t, err) require.NoError(t, err)

Loading…
Cancel
Save