Chore: Define promlib depguard rules (#85082)

* define promlib depguard rules

* add comment

* test: break linting on purpose

* fix linting

* simple change to trigger backend linting/build in CI pipeline
This commit is contained in:
ismail simsek 2024-03-25 17:32:56 +01:00 committed by GitHub
parent 15dca45514
commit 92f5a0305c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -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]

View File

@ -36,7 +36,7 @@ func (rt *healthCheckSuccessRoundTripper) RoundTrip(req *http.Request) (*http.Re
"resultType": "scalar",
"result": [
1692969348.331,
"2"
"3"
]
}
}`)),