Skip to content

Commit

Permalink
build(deps): bump github.com/firefart/nonamedreturns from 1.0.2 to 1.…
Browse files Browse the repository at this point in the history
…0.4 (#2944)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and ldez committed Jun 28, 2022
1 parent 01f1a07 commit 023e1c4
Show file tree
Hide file tree
Showing 9 changed files with 303 additions and 245 deletions.
4 changes: 2 additions & 2 deletions .golangci.reference.yml
Expand Up @@ -1159,9 +1159,9 @@ linters-settings:
require-specific: true

nonamedreturns:
# Do not complain about named error, if it is assigned inside defer.
# Report named error if it is assigned inside defer.
# Default: false
allow-error-in-defer: true
report-error-in-defer: true

paralleltest:
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -24,7 +24,7 @@ require (
github.com/denis-tingaikin/go-header v0.4.3
github.com/esimonov/ifshort v1.0.4
github.com/fatih/color v1.13.0
github.com/firefart/nonamedreturns v1.0.2
github.com/firefart/nonamedreturns v1.0.4
github.com/fzipp/gocyclo v0.6.0
github.com/go-critic/go-critic v0.6.3
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b
Expand Down Expand Up @@ -170,7 +170,7 @@ require (
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d // indirect
golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum

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

2 changes: 1 addition & 1 deletion pkg/config/linters_settings.go
Expand Up @@ -486,7 +486,7 @@ type NoLintLintSettings struct {
}

type NoNamedReturnsSettings struct {
AllowErrorInDefer bool `mapstructure:"allow-error-in-defer"`
ReportErrorInDefer bool `mapstructure:"report-error-in-defer"`
}
type ParallelTestSettings struct {
IgnoreMissing bool `mapstructure:"ignore-missing"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/golinters/nonamedreturns.go
Expand Up @@ -15,7 +15,7 @@ func NewNoNamedReturns(settings *config.NoNamedReturnsSettings) *goanalysis.Lint
if settings != nil {
cfg = map[string]map[string]interface{}{
a.Name: {
analyzer.FlagAllowErrorInDefer: settings.AllowErrorInDefer,
analyzer.FlagReportErrorInDefer: settings.ReportErrorInDefer,
},
}
}
Expand All @@ -25,5 +25,5 @@ func NewNoNamedReturns(settings *config.NoNamedReturnsSettings) *goanalysis.Lint
a.Doc,
[]*analysis.Analyzer{a},
cfg,
).WithLoadMode(goanalysis.LoadModeSyntax)
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}
1 change: 1 addition & 0 deletions pkg/lint/lintersdb/manager.go
Expand Up @@ -627,6 +627,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {

linter.NewConfig(golinters.NewNoNamedReturns(noNamedReturnsCfg)).
WithSince("v1.46.0").
WithLoadForGoAnalysis().
WithPresets(linter.PresetStyle).
WithURL("https://github.com/firefart/nonamedreturns"),

Expand Down
2 changes: 1 addition & 1 deletion test/testdata/configs/nonamedreturns.yml
@@ -1,3 +1,3 @@
linters-settings:
nonamedreturns:
allow-error-in-defer: true
report-error-in-defer: true

0 comments on commit 023e1c4

Please sign in to comment.