Skip to content

Commit 49d26d7

Browse files
committed
chore: update implementation
1 parent cba3c7c commit 49d26d7

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.golangci.next.reference.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,6 +2732,11 @@ linters-settings:
27322732
severity: warning
27332733
disabled: false
27342734
exclude: [""]
2735+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-build-tag
2736+
- name: redundant-build-tag
2737+
severity: warning
2738+
disabled: false
2739+
exclude: [""]
27352740
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-import-alias
27362741
- name: redundant-import-alias
27372742
severity: warning
@@ -2841,6 +2846,11 @@ linters-settings:
28412846
severity: warning
28422847
disabled: false
28432848
exclude: [""]
2849+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#use-errors-new
2850+
- name: use-errors-new
2851+
severity: warning
2852+
disabled: false
2853+
exclude: [""]
28442854
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
28452855
- name: useless-break
28462856
severity: warning

jsonschema/golangci.next.jsonschema.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,12 @@
271271
"nested-structs",
272272
"optimize-operands-order",
273273
"package-comments",
274-
"range",
275274
"range-val-address",
276275
"range-val-in-closure",
276+
"range",
277277
"receiver-naming",
278278
"redefines-builtin-id",
279+
"redundant-build-tag",
279280
"redundant-import-alias",
280281
"string-format",
281282
"string-of-int",
@@ -293,6 +294,7 @@
293294
"unused-parameter",
294295
"unused-receiver",
295296
"use-any",
297+
"use-errors-new",
296298
"useless-break",
297299
"var-declaration",
298300
"var-naming",

pkg/golinters/revive/revive.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ func toIssue(pass *analysis.Pass, object *jsonObject) goanalysis.Issue {
209209
// This function mimics the GetConfig function of revive.
210210
// This allows to get default values and right types.
211211
// https://github.com/golangci/golangci-lint/issues/1745
212-
// https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L220
213-
// https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L172-L178
212+
// https://github.com/mgechev/revive/blob/v1.6.0/config/config.go#L230
213+
// https://github.com/mgechev/revive/blob/v1.6.0/config/config.go#L182-L188
214214
func getConfig(cfg *config.ReviveSettings) (*lint.Config, error) {
215215
conf := defaultConfig()
216216

@@ -307,7 +307,7 @@ func safeTomlSlice(r []any) []any {
307307
}
308308

309309
// This element is not exported by revive, so we need copy the code.
310-
// Extracted from https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L16
310+
// Extracted from https://github.com/mgechev/revive/blob/v1.6.0/config/config.go#L16
311311
var defaultRules = []lint.Rule{
312312
&rule.VarDeclarationsRule{},
313313
&rule.PackageCommentsRule{},
@@ -393,6 +393,8 @@ var allRules = append([]lint.Rule{
393393
&rule.CommentsDensityRule{},
394394
&rule.FileLengthLimitRule{},
395395
&rule.FilenameFormatRule{},
396+
&rule.RedundantBuildTagRule{},
397+
&rule.UseErrorsNewRule{},
396398
}, defaultRules...)
397399

398400
const defaultConfidence = 0.8

0 commit comments

Comments
 (0)