docs: improve ireturn documentation (#4881)

This commit is contained in:
Ludovic Fernandez 2024-07-24 10:23:54 +02:00 committed by GitHub
parent e95ac1b659
commit 65ef38e5c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 38 additions and 20 deletions

View File

@ -1240,26 +1240,35 @@ linters-settings:
max: 5 max: 5
ireturn: ireturn:
# ireturn does not allow using `allow` and `reject` settings at the same time. # List of interfaces to allow.
# Both settings are lists of the keywords and regular expressions matched to interface or package names. # Lists of the keywords and regular expressions matched to interface or package names can be used.
# keywords: # `allow` and `reject` settings cannot be used at the same time.
#
# Keywords:
# - `empty` for `interface{}` # - `empty` for `interface{}`
# - `error` for errors # - `error` for errors
# - `stdlib` for standard library # - `stdlib` for standard library
# - `anon` for anonymous interfaces # - `anon` for anonymous interfaces
# - `generic` for generic interfaces added in go 1.18 # - `generic` for generic interfaces added in go 1.18
#
# By default, it allows using errors, empty interfaces, anonymous interfaces, # Default: [anon, error, empty, stdlib]
# and interfaces provided by the standard library.
allow: allow:
- anon - anon
- error
- empty
- stdlib
# You can specify idiomatic endings for interface # You can specify idiomatic endings for interface
- (or|er)$ - (or|er)$
# reject-list of interfaces # List of interfaces to reject.
# Lists of the keywords and regular expressions matched to interface or package names can be used.
# `allow` and `reject` settings cannot be used at the same time.
#
# Keywords:
# - `empty` for `interface{}`
# - `error` for errors
# - `stdlib` for standard library
# - `anon` for anonymous interfaces
# - `generic` for generic interfaces added in go 1.18
#
# Default: []
reject: reject:
- github.com\/user\/package\/v4\.Type - github.com\/user\/package\/v4\.Type

View File

@ -1240,26 +1240,35 @@ linters-settings:
max: 5 max: 5
ireturn: ireturn:
# ireturn does not allow using `allow` and `reject` settings at the same time. # List of interfaces to allow.
# Both settings are lists of the keywords and regular expressions matched to interface or package names. # Lists of the keywords and regular expressions matched to interface or package names can be used.
# keywords: # `allow` and `reject` settings cannot be used at the same time.
#
# Keywords:
# - `empty` for `interface{}` # - `empty` for `interface{}`
# - `error` for errors # - `error` for errors
# - `stdlib` for standard library # - `stdlib` for standard library
# - `anon` for anonymous interfaces # - `anon` for anonymous interfaces
# - `generic` for generic interfaces added in go 1.18 # - `generic` for generic interfaces added in go 1.18
#
# By default, it allows using errors, empty interfaces, anonymous interfaces, # Default: [anon, error, empty, stdlib]
# and interfaces provided by the standard library.
allow: allow:
- anon - anon
- error
- empty
- stdlib
# You can specify idiomatic endings for interface # You can specify idiomatic endings for interface
- (or|er)$ - (or|er)$
# reject-list of interfaces # List of interfaces to reject.
# Lists of the keywords and regular expressions matched to interface or package names can be used.
# `allow` and `reject` settings cannot be used at the same time.
#
# Keywords:
# - `empty` for `interface{}`
# - `error` for errors
# - `stdlib` for standard library
# - `anon` for anonymous interfaces
# - `generic` for generic interfaces added in go 1.18
#
# Default: []
reject: reject:
- github.com\/user\/package\/v4\.Type - github.com\/user\/package\/v4\.Type