Skip to content

Commit

Permalink
build(deps): bump github.com/raeperd/recvcheck from 0.1.2 to 0.2.0 (#…
Browse files Browse the repository at this point in the history
…5258)

Co-authored-by: Fernandez Ludovic <[email protected]>
  • Loading branch information
dependabot[bot] and ldez authored Dec 26, 2024
1 parent b322a16 commit 8a5d479
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2318,6 +2318,23 @@ linters-settings:
patterns:
- ".*"

recvcheck:
# Disables the built-in method exclusions:
# - `MarshalText`
# - `MarshalJSON`
# - `MarshalYAML`
# - `MarshalXML`
# - `MarshalBinary`
# - `GobEncode`
# Default: false
disable-builtin: true
# User-defined method exclusions.
# The format is `struct_name.method_name` (ex: `Foo.MethodName`).
# A wildcard `*` can use as a struct name (ex: `*.MethodName`).
# Default: []
exclusions:
- "*.Value"

revive:
# Maximum number of open files at the same time.
# See https://github.com/mgechev/revive#command-line-flags
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ require (
github.com/pelletier/go-toml/v2 v2.2.3
github.com/polyfloyd/go-errorlint v1.7.0
github.com/quasilyte/go-ruleguard/dsl v0.3.22
github.com/raeperd/recvcheck v0.1.2
github.com/raeperd/recvcheck v0.2.0
github.com/rogpeppe/go-internal v1.13.1
github.com/ryancurrah/gomodguard v1.3.5
github.com/ryanrolds/sqlclosecheck v0.5.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,24 @@
}
}
},
"recvcheck": {
"type": "object",
"additionalProperties": false,
"properties": {
"disable-builtin": {
"description": "Disables the built-in method exclusions.",
"type": "boolean",
"default": true
},
"exclusions": {
"description": "User-defined method exclusions.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"nonamedreturns": {
"type": "object",
"additionalProperties": false,
Expand Down
6 changes: 6 additions & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ type LintersSettings struct {
Promlinter PromlinterSettings
ProtoGetter ProtoGetterSettings
Reassign ReassignSettings
Recvcheck RecvcheckSettings
Revive ReviveSettings
RowsErrCheck RowsErrCheckSettings
SlogLint SlogLintSettings
Expand Down Expand Up @@ -819,6 +820,11 @@ type ReassignSettings struct {
Patterns []string `mapstructure:"patterns"`
}

type RecvcheckSettings struct {
DisableBuiltin bool `mapstructure:"disable-builtin"`
Exclusions []string `mapstructure:"exclusions"`
}

type ReviveSettings struct {
Go string `mapstructure:"-"`
MaxOpenFiles int `mapstructure:"max-open-files"`
Expand Down
12 changes: 10 additions & 2 deletions pkg/golinters/recvcheck/recvcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ import (
"github.com/raeperd/recvcheck"
"golang.org/x/tools/go/analysis"

"github.com/golangci/golangci-lint/pkg/config"
"github.com/golangci/golangci-lint/pkg/goanalysis"
)

func New() *goanalysis.Linter {
a := recvcheck.Analyzer
func New(settings *config.RecvcheckSettings) *goanalysis.Linter {
var cfg recvcheck.Settings

if settings != nil {
cfg.DisableBuiltin = settings.DisableBuiltin
cfg.Exclusions = settings.Exclusions
}

a := recvcheck.NewAnalyzer(cfg)

return goanalysis.NewLinter(
a.Name,
Expand Down
2 changes: 1 addition & 1 deletion pkg/lint/lintersdb/builder_linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
WithLoadForGoAnalysis().
WithURL("https://github.com/curioswitch/go-reassign"),

linter.NewConfig(recvcheck.New()).
linter.NewConfig(recvcheck.New(&cfg.LintersSettings.Recvcheck)).
WithSince("v1.62.0").
WithPresets(linter.PresetBugs).
WithLoadForGoAnalysis().
Expand Down

0 comments on commit 8a5d479

Please sign in to comment.