@@ -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.
0 commit comments