From 1611bca2ff2578815255a8ba433d1f2b5c1409e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 20:47:55 +0200 Subject: [PATCH] build(deps): bump github.com/jjti/go-spancheck from 0.5.3 to 0.6.0 (#4670) Co-authored-by: Fernandez Ludovic --- .golangci.next.reference.yml | 8 +++++++- go.mod | 2 +- go.sum | 4 ++-- jsonschema/golangci.next.jsonschema.json | 7 +++++++ pkg/config/linters_settings.go | 5 +++-- pkg/golinters/spancheck/spancheck.go | 4 ++++ 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index 860e4fc2..1bb27950 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -2051,7 +2051,13 @@ linters-settings: # Default: [] ignore-check-signatures: - "telemetry.RecordError" - + # A list of regexes for additional function signatures that create spans. + # This is useful if you have a utility method to create spans. + # Each entry should be of the form `:`, where `telemetry-type` can be `opentelemetry` or `opencensus`. + # https://github.com/jjti/go-spancheck#extra-start-span-signatures + # Default: [] + extra-start-span-signatures: + - "github.com/user/repo/telemetry/trace.Start:opentelemetry" staticcheck: # Deprecated: use the global `run.go` instead. go: "1.15" diff --git a/go.mod b/go.mod index bb18ea37..d2e324dc 100644 --- a/go.mod +++ b/go.mod @@ -57,7 +57,7 @@ require ( github.com/jgautheron/goconst v1.7.1 github.com/jingyugao/rowserrcheck v1.1.1 github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af - github.com/jjti/go-spancheck v0.5.3 + github.com/jjti/go-spancheck v0.6.0 github.com/julz/importas v0.1.0 github.com/karamaru-alpha/copyloopvar v1.1.0 github.com/kisielk/errcheck v1.7.0 diff --git a/go.sum b/go.sum index fc5b307f..e0a936d3 100644 --- a/go.sum +++ b/go.sum @@ -305,8 +305,8 @@ github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjz github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jjti/go-spancheck v0.5.3 h1:vfq4s2IB8T3HvbpiwDTYgVPj1Ze/ZSXrTtaZRTc7CuM= -github.com/jjti/go-spancheck v0.5.3/go.mod h1:eQdOX1k3T+nAKvZDyLC3Eby0La4dZ+I19iOl5NzSPFE= +github.com/jjti/go-spancheck v0.6.0 h1:pOiwyYRdEBfMjsl9TRzxqcpVV2LXKPXynxUmY96PGM8= +github.com/jjti/go-spancheck v0.6.0/go.mod h1:vF1QkOO159prdo6mHRxak2CpzDpHAfKiPUDP/NeRnX8= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index 2d2673b8..5112fff1 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -2337,6 +2337,13 @@ "items": { "type": "string" } + }, + "extra-start-span-signatures": { + "description": "A list of regexes for additional function signatures that create spans.", + "type": "array", + "items": { + "type": "string" + } } } }, diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index eccf368b..01894ddf 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -823,8 +823,9 @@ type SlogLintSettings struct { } type SpancheckSettings struct { - Checks []string `mapstructure:"checks"` - IgnoreCheckSignatures []string `mapstructure:"ignore-check-signatures"` + Checks []string `mapstructure:"checks"` + IgnoreCheckSignatures []string `mapstructure:"ignore-check-signatures"` + ExtraStartSpanSignatures []string `mapstructure:"extra-start-span-signatures"` } type StaticCheckSettings struct { diff --git a/pkg/golinters/spancheck/spancheck.go b/pkg/golinters/spancheck/spancheck.go index 9bee6cb4..a800a170 100644 --- a/pkg/golinters/spancheck/spancheck.go +++ b/pkg/golinters/spancheck/spancheck.go @@ -19,6 +19,10 @@ func New(settings *config.SpancheckSettings) *goanalysis.Linter { if settings.IgnoreCheckSignatures != nil { cfg.IgnoreChecksSignaturesSlice = settings.IgnoreCheckSignatures } + + if settings.ExtraStartSpanSignatures != nil { + cfg.StartSpanMatchersSlice = settings.ExtraStartSpanSignatures + } } a := spancheck.NewAnalyzerWithConfig(cfg)