Skip to content

Commit 2731071

Browse files
docs: update documentation assets (#6001)
1 parent bae4cb7 commit 2731071

File tree

3 files changed

+52
-6
lines changed

3 files changed

+52
-6
lines changed

.golangci.reference.yml

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

504504
exhaustruct:
505-
# List of regular expressions to match struct packages and their names.
506-
# Regular expressions must match complete canonical struct package/name/structname.
507-
# If this list is empty, all structs are tested.
505+
# List of regular expressions to match type names that should be processed.
506+
# Anonymous structs can be matched by '<anonymous>' alias.
507+
#
508+
# 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 `.*/http\.Cookie`,
510+
# but not `http\.Cookie`.
508511
# Default: []
509512
include:
510513
- '.+\.Test'
511514
- 'example\.com/package\.ExampleStruct[\d]{1,2}'
512-
# List of regular expressions to exclude struct packages and their names from checks.
513-
# Regular expressions must match complete canonical struct package/name/structname.
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`.
518+
# Each regular expression must match the full type name, including package path.
519+
# For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
520+
# but not `http\.Cookie`.
514521
# Default: []
515522
exclude:
516523
- '.+/cobra\.Command$'
524+
# Allows empty structures, effectively excluding them from the check.
525+
# Default: false
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.
529+
# Each regular expression must match the full type name, including package path.
530+
# For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`,
531+
# but not `http\.Cookie`.
532+
# Default: []
533+
allow-empty-rx:
534+
- '.*/http\.Cookie'
535+
# Allows empty structures in return statements.
536+
# Default: false
537+
allow-empty-returns: true
538+
# Allows empty structures in variable declarations.
539+
# Default: false
540+
allow-empty-declarations: true
517541

518542
fatcontext:
519543
# Check for potential fat contexts in struct pointers.

docs/data/linters_info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
"originalURL": "https://github.com/nishanths/exhaustive",
203203
"internal": false,
204204
"isSlow": true,
205-
"since": " v1.28.0"
205+
"since": "v1.28.0"
206206
},
207207
{
208208
"name": "exhaustruct",

jsonschema/golangci.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)