diff --git a/.golangci.toml b/.golangci.toml index 3cc94f93e1d..04932ab53a0 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -67,6 +67,19 @@ files = [ "**/pkg/tsdb/cloudwatch/**/*", ] +[linters-settings.depguard.rules.promlib] +list-mode = "lax" # allow unless explicitely denied +deny = [ + { pkg = "github.com/grafana/grafana/pkg", desc = "promlib is not allowed to import grafana core" } +] +allow = [ + "github.com/grafana/grafana/pkg/promlib" +] +files = [ + "**/pkg/promlib/*", + "**/pkg/promlib/**/*" +] + [linters-settings.gocritic] enabled-checks = ["ruleguard"] [linters-settings.gocritic.settings.ruleguard] diff --git a/pkg/promlib/healthcheck_test.go b/pkg/promlib/healthcheck_test.go index c60fc074726..bb8746f5a0a 100644 --- a/pkg/promlib/healthcheck_test.go +++ b/pkg/promlib/healthcheck_test.go @@ -36,7 +36,7 @@ func (rt *healthCheckSuccessRoundTripper) RoundTrip(req *http.Request) (*http.Re "resultType": "scalar", "result": [ 1692969348.331, - "2" + "3" ] } }`)),