Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump github.com/raeperd/recvcheck from 0.1.2 to 0.2.0 #5258

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading