Skip to content

Commit 5eecc41

Browse files
committed
review
1 parent 95a6aba commit 5eecc41

File tree

3 files changed

+39
-22
lines changed

3 files changed

+39
-22
lines changed

.golangci.next.reference.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -502,45 +502,42 @@ linters:
502502
default-case-required: true
503503

504504
exhaustruct:
505-
# List of regular expressions to match type names that should be
506-
# processed. Anonymous structs can be matched by '<anonymous>' alias.
505+
# List of regular expressions to match type names that should be processed.
506+
# Anonymous structs can be matched by '<anonymous>' alias.
507507
#
508508
# Each regular expression must match the full type name, including package path.
509-
# For example, to match type `net/http.Cookie` regular expression should be
510-
# `.*/http\.Cookie`, but not `http\.Cookie`.
511-
#
509+
# For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
510+
# but not `http\.Cookie`.
512511
# Default: []
513512
include:
514513
- '.+\.Test'
515514
- 'example\.com/package\.ExampleStruct[\d]{1,2}'
516-
# List of regular expressions to match type names that should be
517-
# excluded from processing. Anonymous structs can be matched by '<anonymous>'
518-
# alias.
519-
# Has precedence over IncludeRx.
515+
# List of regular expressions to match type names that should be excluded from processing.
516+
# Anonymous structs can be matched by '<anonymous>' alias.
517+
# Has precedence over `include`.
520518
# Each regular expression must match the full type name, including package path.
521-
# For example, to match type `net/http.Cookie` regular expression should be
522-
# `.*/http\.Cookie`, but not `http\.Cookie`.
519+
# For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
520+
# but not `http\.Cookie`.
523521
# Default: []
524522
exclude:
525523
- '.+/cobra\.Command$'
526-
# AllowEmpty allows empty structures, effectively excluding them from the check.
524+
# Allows empty structures, effectively excluding them from the check.
527525
# Default: false
528-
allow-empty: false
529-
# List of regular expressions to match type names that should be
530-
# allowed to be empty. Anonymous structs can be matched by '<anonymous>'
531-
# alias.
526+
allow-empty: true
527+
# List of regular expressions to match type names that should be allowed to be empty.
528+
# Anonymous structs can be matched by '<anonymous>' alias.
532529
# Each regular expression must match the full type name, including package path.
533-
# For example, to match type `net/http.Cookie` regular expression should be
534-
# `.*/http\.Cookie`, but not `http\.Cookie`.
530+
# For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
531+
# but not `http\.Cookie`.
535532
# Default: []
536533
allow-empty-rx:
537534
- '.*/http\.Cookie'
538535
# Allows empty structures in return statements.
539536
# Default: false
540-
allow-empty-returns: false
537+
allow-empty-returns: true
541538
# Allows empty structures in variable declarations.
542539
# Default: false
543-
allow-empty-declarations: false
540+
allow-empty-declarations: true
544541

545542
fatcontext:
546543
# Check for potential fat contexts in struct pointers.

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module github.com/golangci/golangci-lint/v2
22

33
go 1.24
44

5-
toolchain go1.24.6
6-
75
require (
86
4d63.com/gocheckcompilerdirectives v1.3.0
97
4d63.com/gochecknoglobals v0.2.2

jsonschema/golangci.next.jsonschema.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,28 @@
13051305
"items": {
13061306
"type": "string"
13071307
}
1308+
},
1309+
"allow-empty": {
1310+
"description": "Allows empty structures, effectively excluding them from the check.",
1311+
"type": "boolean",
1312+
"default": false
1313+
},
1314+
"allow-empty-rx": {
1315+
"description": "List of regular expressions to match type names that should be allowed to be empty.",
1316+
"type": "array",
1317+
"items": {
1318+
"type": "string"
1319+
}
1320+
},
1321+
"allow-empty-returns": {
1322+
"description": "Allows empty structures in return statements.",
1323+
"type": "boolean",
1324+
"default": false
1325+
},
1326+
"allow-empty-declarations": {
1327+
"description": "Allows empty structures in variable declarations.",
1328+
"type": "boolean",
1329+
"default": false
13081330
}
13091331
}
13101332
},

0 commit comments

Comments
 (0)