Skip to content

Commit 15ed525

Browse files
committed
chore: update implementation
1 parent 0cac38b commit 15ed525

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.golangci.next.reference.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,16 +2492,33 @@ linters-settings:
24922492
disabled: false
24932493
exclude: [""]
24942494
arguments:
2495-
- "preserveScope"
24962495
- "checkPrivateReceivers"
2497-
- "sayRepetitiveInsteadOfStutters"
2496+
- "disableStutteringCheck"
2497+
- "checkPublicInterface"
2498+
- "disableChecksOnFunctions"
24982499
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header
24992500
- name: file-header
25002501
severity: warning
25012502
disabled: false
25022503
exclude: [""]
25032504
arguments:
25042505
- This is the text that must appear at the top of source files.
2506+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-length-limit
2507+
- name: file-length-limit
2508+
severity: warning
2509+
disabled: false
2510+
exclude: [""]
2511+
arguments:
2512+
- max: 100
2513+
skipComments: true
2514+
skipBlankLines: true
2515+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#filename-format
2516+
- name: filename-format
2517+
severity: warning
2518+
disabled: false
2519+
exclude: [""]
2520+
arguments:
2521+
- "^[_a-z][_a-z0-9]*.go$"
25052522
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter
25062523
- name: flag-parameter
25072524
severity: warning
@@ -2629,6 +2646,8 @@ linters-settings:
26292646
severity: warning
26302647
disabled: false
26312648
exclude: [""]
2649+
arguments:
2650+
- maxLength: 2
26322651
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id
26332652
- name: redefines-builtin-id
26342653
severity: warning

jsonschema/golangci.next.jsonschema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@
248248
"errorf",
249249
"exported",
250250
"file-header",
251+
"file-length-limit",
252+
"filename-format",
251253
"flag-parameter",
252254
"function-length",
253255
"function-result-limit",

pkg/golinters/revive/revive.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ func toIssue(pass *analysis.Pass, object *jsonObject) goanalysis.Issue {
184184
// This function mimics the GetConfig function of revive.
185185
// This allows to get default values and right types.
186186
// https://github.com/golangci/golangci-lint/issues/1745
187-
// https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L218
188-
// https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L170-L176
187+
// https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L220
188+
// https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L172-L178
189189
func getConfig(cfg *config.ReviveSettings) (*lint.Config, error) {
190190
conf := defaultConfig()
191191

@@ -284,7 +284,7 @@ func safeTomlSlice(r []any) []any {
284284
}
285285

286286
// This element is not exported by revive, so we need copy the code.
287-
// Extracted from https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L16
287+
// Extracted from https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L16
288288
var defaultRules = []lint.Rule{
289289
&rule.VarDeclarationsRule{},
290290
&rule.PackageCommentsRule{},
@@ -368,12 +368,14 @@ var allRules = append([]lint.Rule{
368368
&rule.EnforceSliceStyleRule{},
369369
&rule.MaxControlNestingRule{},
370370
&rule.CommentsDensityRule{},
371+
&rule.FileLengthLimitRule{},
372+
&rule.FilenameFormatRule{},
371373
}, defaultRules...)
372374

373375
const defaultConfidence = 0.8
374376

375377
// This element is not exported by revive, so we need copy the code.
376-
// Extracted from https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L181
378+
// Extracted from https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L183
377379
func normalizeConfig(cfg *lint.Config) {
378380
// NOTE(ldez): this custom section for golangci-lint should be kept.
379381
// ---
@@ -419,7 +421,7 @@ func normalizeConfig(cfg *lint.Config) {
419421
}
420422

421423
// This element is not exported by revive, so we need copy the code.
422-
// Extracted from https://github.com/mgechev/revive/blob/v1.4.0/config/config.go#L181
424+
// Extracted from https://github.com/mgechev/revive/blob/v1.5.0/config/config.go#L252
423425
func defaultConfig() *lint.Config {
424426
defaultConfig := lint.Config{
425427
Confidence: defaultConfidence,

0 commit comments

Comments
 (0)