Skip to content

Commit ab79c81

Browse files
dependabot[bot]ldez
authored andcommitted
build(deps): bump github.com/mgechev/revive from 1.2.1 to 1.2.2 (golangci#3075)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 08cac12 commit ab79c81

File tree

5 files changed

+22
-50
lines changed

5 files changed

+22
-50
lines changed

.golangci.reference.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,10 @@ linters-settings:
13411341
severity: warning
13421342
disabled: false
13431343
arguments: [ 3 ]
1344+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace
1345+
- name: datarace
1346+
severity: warning
1347+
disabled: false
13441348
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit
13451349
- name: deep-exit
13461350
severity: warning

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ require (
6161
github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // v1.0
6262
github.com/mattn/go-colorable v0.1.12
6363
github.com/mbilski/exhaustivestruct v1.2.0
64-
github.com/mgechev/revive v1.2.1
64+
github.com/mgechev/revive v1.2.2
6565
github.com/mitchellh/go-homedir v1.1.0
6666
github.com/mitchellh/go-ps v1.0.0
6767
github.com/moricho/tparallel v0.2.1
@@ -114,7 +114,7 @@ require (
114114
github.com/Masterminds/semver v1.5.0 // indirect
115115
github.com/beorn7/perks v1.0.1 // indirect
116116
github.com/cespare/xxhash/v2 v2.1.2 // indirect
117-
github.com/chavacava/garif v0.0.0-20220316182200-5cad0b5181d4 // indirect
117+
github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 // indirect
118118
github.com/davecgh/go-spew v1.1.1 // indirect
119119
github.com/ettle/strcase v0.1.1 // indirect
120120
github.com/fatih/structtag v1.2.0 // indirect

go.sum

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

pkg/config/issues.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ var DefaultExcludePatterns = []ExcludePattern{
9797
},
9898
{
9999
ID: "EXC0015",
100-
Pattern: `should have a package comment, unless it's in another file for this package`,
100+
Pattern: `should have a package comment`,
101101
Linter: "revive",
102102
Why: "Annoying issue about not having a comment. The rare codebase has such comments",
103103
},

pkg/golinters/revive.go

+11-42
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"go/token"
88
"os"
99
"reflect"
10-
"strings"
1110
"sync"
1211

1312
"github.com/BurntSushi/toml"
@@ -183,7 +182,6 @@ func getReviveConfig(cfg *config.ReviveSettings) (*lint.Config, error) {
183182
}
184183

185184
normalizeConfig(conf)
186-
ignoreRules(conf)
187185

188186
reviveDebugf("revive configuration: %#v", conf)
189187

@@ -252,23 +250,23 @@ func safeTomlSlice(r []interface{}) []interface{} {
252250
// This element is not exported by revive, so we need copy the code.
253251
// Extracted from https://github.com/mgechev/revive/blob/v1.1.4/config/config.go#L15
254252
var defaultRules = []lint.Rule{
255-
// &rule.VarDeclarationsRule{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (var-declaration)
253+
&rule.VarDeclarationsRule{},
256254
&rule.PackageCommentsRule{},
257255
&rule.DotImportsRule{},
258256
&rule.BlankImportsRule{},
259257
&rule.ExportedRule{},
260258
&rule.VarNamingRule{},
261259
&rule.IndentErrorFlowRule{},
262260
&rule.RangeRule{},
263-
// &rule.ErrorfRule{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (errorf
261+
&rule.ErrorfRule{},
264262
&rule.ErrorNamingRule{},
265263
&rule.ErrorStringsRule{},
266264
&rule.ReceiverNamingRule{},
267265
&rule.IncrementDecrementRule{},
268266
&rule.ErrorReturnRule{},
269-
// &rule.UnexportedReturnRule{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (unexported-return)
270-
// &rule.TimeNamingRule{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (time-naming)
271-
// &rule.ContextKeysType{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (context-keys-type)
267+
&rule.UnexportedReturnRule{},
268+
&rule.TimeNamingRule{},
269+
&rule.ContextKeysType{},
272270
&rule.ContextAsArgumentRule{},
273271
}
274272

@@ -289,15 +287,15 @@ var allRules = append([]lint.Rule{
289287
&rule.FlagParamRule{},
290288
&rule.UnnecessaryStmtRule{},
291289
&rule.StructTagRule{},
292-
// &rule.ModifiesValRecRule{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (modifies-value-receiver)
290+
&rule.ModifiesValRecRule{},
293291
&rule.ConstantLogicalExprRule{},
294292
&rule.BoolLiteralRule{},
295293
&rule.RedefinesBuiltinIDRule{},
296294
&rule.ImportsBlacklistRule{},
297295
&rule.FunctionResultsLimitRule{},
298296
&rule.MaxPublicStructsRule{},
299297
&rule.RangeValInClosureRule{},
300-
// &rule.RangeValAddress{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (range-val-address)
298+
&rule.RangeValAddress{},
301299
&rule.WaitGroupByValueRule{},
302300
&rule.AtomicRule{},
303301
&rule.EmptyLinesRule{},
@@ -307,9 +305,9 @@ var allRules = append([]lint.Rule{
307305
&rule.ImportShadowingRule{},
308306
&rule.BareReturnRule{},
309307
&rule.UnusedReceiverRule{},
310-
// &rule.UnhandledErrorRule{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (unhandled-error)
308+
&rule.UnhandledErrorRule{},
311309
&rule.CognitiveComplexityRule{},
312-
// &rule.StringOfIntRule{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (string-of-int)
310+
&rule.StringOfIntRule{},
313311
&rule.StringFormatRule{},
314312
&rule.EarlyReturnRule{},
315313
&rule.UnconditionalRecursionRule{},
@@ -320,9 +318,10 @@ var allRules = append([]lint.Rule{
320318
&rule.NestedStructs{},
321319
&rule.IfReturnRule{},
322320
&rule.UselessBreak{},
323-
// &rule.TimeEqualRule{}, // TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997 (time-equal)
321+
&rule.TimeEqualRule{},
324322
&rule.BannedCharsRule{},
325323
&rule.OptimizeOperandsOrderRule{},
324+
&rule.DataRaceRule{},
326325
}, defaultRules...)
327326

328327
const defaultConfidence = 0.8
@@ -386,33 +385,3 @@ func defaultConfig() *lint.Config {
386385
}
387386
return &defaultConfig
388387
}
389-
390-
// TODO(ldez) https://github.com/golangci/golangci-lint/issues/2997
391-
func ignoreRules(conf *lint.Config) {
392-
f := []string{
393-
"context-keys-type",
394-
"errorf",
395-
"modifies-value-receiver",
396-
"range-val-address",
397-
"string-of-int",
398-
"time-equal",
399-
"time-naming",
400-
"unexported-return",
401-
"unhandled-error",
402-
"var-declaration",
403-
}
404-
405-
var ignored []string
406-
for _, s := range f {
407-
if _, ok := conf.Rules[s]; ok {
408-
delete(conf.Rules, s)
409-
ignored = append(ignored, s)
410-
}
411-
}
412-
413-
if len(ignored) > 0 {
414-
linterLogger.Warnf("revive: the following rules (%s) are ignored due to a performance problem "+
415-
"(https://github.com/golangci/golangci-lint/issues/2997)",
416-
strings.Join(ignored, ","))
417-
}
418-
}

0 commit comments

Comments
 (0)