Skip to content

Commit 8a5d479

Browse files
build(deps): bump github.com/raeperd/recvcheck from 0.1.2 to 0.2.0 (#5258)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent b322a16 commit 8a5d479

File tree

7 files changed

+55
-6
lines changed

7 files changed

+55
-6
lines changed

.golangci.next.reference.yml

+17
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,23 @@ linters-settings:
23182318
patterns:
23192319
- ".*"
23202320

2321+
recvcheck:
2322+
# Disables the built-in method exclusions:
2323+
# - `MarshalText`
2324+
# - `MarshalJSON`
2325+
# - `MarshalYAML`
2326+
# - `MarshalXML`
2327+
# - `MarshalBinary`
2328+
# - `GobEncode`
2329+
# Default: false
2330+
disable-builtin: true
2331+
# User-defined method exclusions.
2332+
# The format is `struct_name.method_name` (ex: `Foo.MethodName`).
2333+
# A wildcard `*` can use as a struct name (ex: `*.MethodName`).
2334+
# Default: []
2335+
exclusions:
2336+
- "*.Value"
2337+
23212338
revive:
23222339
# Maximum number of open files at the same time.
23232340
# See https://github.com/mgechev/revive#command-line-flags

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ require (
8484
github.com/pelletier/go-toml/v2 v2.2.3
8585
github.com/polyfloyd/go-errorlint v1.7.0
8686
github.com/quasilyte/go-ruleguard/dsl v0.3.22
87-
github.com/raeperd/recvcheck v0.1.2
87+
github.com/raeperd/recvcheck v0.2.0
8888
github.com/rogpeppe/go-internal v1.13.1
8989
github.com/ryancurrah/gomodguard v1.3.5
9090
github.com/ryanrolds/sqlclosecheck v0.5.1

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsonschema/golangci.next.jsonschema.json

+18
Original file line numberDiff line numberDiff line change
@@ -2394,6 +2394,24 @@
23942394
}
23952395
}
23962396
},
2397+
"recvcheck": {
2398+
"type": "object",
2399+
"additionalProperties": false,
2400+
"properties": {
2401+
"disable-builtin": {
2402+
"description": "Disables the built-in method exclusions.",
2403+
"type": "boolean",
2404+
"default": true
2405+
},
2406+
"exclusions": {
2407+
"description": "User-defined method exclusions.",
2408+
"type": "array",
2409+
"items": {
2410+
"type": "string"
2411+
}
2412+
}
2413+
}
2414+
},
23972415
"nonamedreturns": {
23982416
"type": "object",
23992417
"additionalProperties": false,

pkg/config/linters_settings.go

+6
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ type LintersSettings struct {
270270
Promlinter PromlinterSettings
271271
ProtoGetter ProtoGetterSettings
272272
Reassign ReassignSettings
273+
Recvcheck RecvcheckSettings
273274
Revive ReviveSettings
274275
RowsErrCheck RowsErrCheckSettings
275276
SlogLint SlogLintSettings
@@ -819,6 +820,11 @@ type ReassignSettings struct {
819820
Patterns []string `mapstructure:"patterns"`
820821
}
821822

823+
type RecvcheckSettings struct {
824+
DisableBuiltin bool `mapstructure:"disable-builtin"`
825+
Exclusions []string `mapstructure:"exclusions"`
826+
}
827+
822828
type ReviveSettings struct {
823829
Go string `mapstructure:"-"`
824830
MaxOpenFiles int `mapstructure:"max-open-files"`

pkg/golinters/recvcheck/recvcheck.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ import (
44
"github.com/raeperd/recvcheck"
55
"golang.org/x/tools/go/analysis"
66

7+
"github.com/golangci/golangci-lint/pkg/config"
78
"github.com/golangci/golangci-lint/pkg/goanalysis"
89
)
910

10-
func New() *goanalysis.Linter {
11-
a := recvcheck.Analyzer
11+
func New(settings *config.RecvcheckSettings) *goanalysis.Linter {
12+
var cfg recvcheck.Settings
13+
14+
if settings != nil {
15+
cfg.DisableBuiltin = settings.DisableBuiltin
16+
cfg.Exclusions = settings.Exclusions
17+
}
18+
19+
a := recvcheck.NewAnalyzer(cfg)
1220

1321
return goanalysis.NewLinter(
1422
a.Name,

pkg/lint/lintersdb/builder_linter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
672672
WithLoadForGoAnalysis().
673673
WithURL("https://github.com/curioswitch/go-reassign"),
674674

675-
linter.NewConfig(recvcheck.New()).
675+
linter.NewConfig(recvcheck.New(&cfg.LintersSettings.Recvcheck)).
676676
WithSince("v1.62.0").
677677
WithPresets(linter.PresetBugs).
678678
WithLoadForGoAnalysis().

0 commit comments

Comments
 (0)