@@ -65,7 +65,7 @@ func NewRevive(cfg *config.ReviveSettings) *goanalysis.Linter {
65
65
return nil , err
66
66
}
67
67
68
- revive := lint .New (os .ReadFile )
68
+ revive := lint .New (os .ReadFile , cfg . MaxOpenFiles )
69
69
70
70
lintingRules , err := reviveConfig .GetLintingRules (conf )
71
71
if err != nil {
@@ -148,7 +148,7 @@ func reviveToIssue(pass *analysis.Pass, object *jsonObject) goanalysis.Issue {
148
148
// This function mimics the GetConfig function of revive.
149
149
// This allows to get default values and right types.
150
150
// https://github.com/golangci/golangci-lint/issues/1745
151
- // https://github.com/mgechev/revive/blob/389ba853b0b3587f0c3b71b5f0c61ea4e23928ec /config/config.go#L155
151
+ // https://github.com/mgechev/revive/blob/v1.1.4 /config/config.go#L182
152
152
func getReviveConfig (cfg * config.ReviveSettings ) (* lint.Config , error ) {
153
153
conf := defaultConfig ()
154
154
@@ -235,7 +235,7 @@ func safeTomlSlice(r []interface{}) []interface{} {
235
235
}
236
236
237
237
// This element is not exported by revive, so we need copy the code.
238
- // Extracted from https://github.com/mgechev/revive/blob/111721be475b73b5a2304dd01ccbcab587357fca /config/config.go#L15
238
+ // Extracted from https://github.com/mgechev/revive/blob/v1.1.4 /config/config.go#L15
239
239
var defaultRules = []lint.Rule {
240
240
& rule.VarDeclarationsRule {},
241
241
& rule.PackageCommentsRule {},
@@ -310,14 +310,11 @@ var allRules = append([]lint.Rule{
310
310
& rule.OptimizeOperandsOrderRule {},
311
311
}, defaultRules ... )
312
312
313
+ const defaultConfidence = 0.8
314
+
313
315
// This element is not exported by revive, so we need copy the code.
314
- // Extracted from https://github.com/mgechev/revive/blob/111721be475b73b5a2304dd01ccbcab587357fca /config/config.go#L143
316
+ // Extracted from https://github.com/mgechev/revive/blob/v1.1.4 /config/config.go#L145
315
317
func normalizeConfig (cfg * lint.Config ) {
316
- const defaultConfidence = 0.8
317
- if cfg .Confidence == 0 {
318
- cfg .Confidence = defaultConfidence
319
- }
320
-
321
318
if len (cfg .Rules ) == 0 {
322
319
cfg .Rules = map [string ]lint.RuleConfig {}
323
320
}
@@ -352,10 +349,10 @@ func normalizeConfig(cfg *lint.Config) {
352
349
}
353
350
354
351
// This element is not exported by revive, so we need copy the code.
355
- // Extracted from https://github.com/mgechev/revive/blob/111721be475b73b5a2304dd01ccbcab587357fca /config/config.go#L210
352
+ // Extracted from https://github.com/mgechev/revive/blob/v1.1.4 /config/config.go#L214
356
353
func defaultConfig () * lint.Config {
357
354
defaultConfig := lint.Config {
358
- Confidence : 0.0 ,
355
+ Confidence : defaultConfidence ,
359
356
Severity : lint .SeverityWarning ,
360
357
Rules : map [string ]lint.RuleConfig {},
361
358
}
0 commit comments