Skip to content

Commit

Permalink
Add promlinter to set of CI linters
Browse files Browse the repository at this point in the history
Signed-off-by: Shyamsundar Ranganathan <[email protected]>
  • Loading branch information
ShyamsundarR authored and BenamarMk committed Apr 26, 2024
1 parent 4ea7208 commit 44c146a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
4 changes: 3 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ linters-settings:
SPDX-License-Identifier: Apache-2.0
misspell:
locale: US
promlinter:
strict: true
wsl:
allow-trailing-comment: true
enforce-err-cuddling: true
Expand Down Expand Up @@ -149,6 +151,7 @@ linters:
- nosprintfhostport
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
Expand Down Expand Up @@ -192,6 +195,5 @@ linters:
# - containedctx
# - nonamedreturns
# - forcetypeassert
# - promlinter
# - contextcheck
# - errname
30 changes: 0 additions & 30 deletions controllers/util/mw_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,6 @@ import (
ocmworkv1 "github.com/open-cluster-management/api/work/v1"
rmnutil "github.com/ramendr/ramen/controllers/util"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/prometheus/client_golang/prometheus"
"sigs.k8s.io/controller-runtime/pkg/metrics"
)

// register Prometheus metrics for testing
func init() {
metrics.Registry.MustRegister(testGauge, testCounter, testHistogram)
}

var (
testGauge = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "ramen_test_gauge",
Help: "Test Gauge for use in MW_Util only",
})

testCounter = prometheus.NewCounter(
prometheus.CounterOpts{
Name: "ramen_test_counter",
Help: "Test Counter for use in MW_Util only",
},
)

testHistogram = prometheus.NewHistogram(
prometheus.HistogramOpts{
Name: "ramen_test_histogram",
Help: "Test Histogram for use in MW_Util only",
Buckets: prometheus.ExponentialBuckets(1.0, 2.0, 12),
},
)
)

var _ = Describe("IsManifestInAppliedState", func() {
Expand Down

0 comments on commit 44c146a

Please sign in to comment.