Skip to content

Commit 62d7ebf

Browse files
docs: update documentation assets (#5269)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 7bbe17d commit 62d7ebf

File tree

9 files changed

+4444
-103
lines changed

9 files changed

+4444
-103
lines changed

.golangci.reference.yml

+187-14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ linters:
3535
- exhaustive
3636
- exhaustruct
3737
- exportloopref
38+
- exptostd
3839
- fatcontext
3940
- forbidigo
4041
- forcetypeassert
@@ -81,6 +82,7 @@ linters:
8182
- nakedret
8283
- nestif
8384
- nilerr
85+
- nilnesserr
8486
- nilnil
8587
- nlreturn
8688
- noctx
@@ -114,6 +116,7 @@ linters:
114116
- unparam
115117
- unused
116118
- usestdlibvars
119+
- usetesting
117120
- varnamelen
118121
- wastedassign
119122
- whitespace
@@ -151,6 +154,7 @@ linters:
151154
- exhaustive
152155
- exhaustruct
153156
- exportloopref
157+
- exptostd
154158
- fatcontext
155159
- forbidigo
156160
- forcetypeassert
@@ -197,6 +201,7 @@ linters:
197201
- nakedret
198202
- nestif
199203
- nilerr
204+
- nilnesserr
200205
- nilnil
201206
- nlreturn
202207
- noctx
@@ -230,6 +235,7 @@ linters:
230235
- unparam
231236
- unused
232237
- usestdlibvars
238+
- usetesting
233239
- varnamelen
234240
- wastedassign
235241
- whitespace
@@ -592,6 +598,14 @@ linters-settings:
592598
- alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
593599
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
594600

601+
# Checks that no inline Comments are present.
602+
# Default: false
603+
no-inline-comments: true
604+
605+
# Checks that no prefix Comments(comment lines above an import) are present.
606+
# Default: false
607+
no-prefix-comments: true
608+
595609
# Skip generated files.
596610
# Default: true
597611
skip-generated: false
@@ -660,6 +674,9 @@ linters-settings:
660674
# Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed.
661675
# Default: true
662676
default-signifies-exhaustive: false
677+
# Include shared interfaces in the exhaustiviness check.
678+
# Default: false
679+
include-shared-interfaces: true
663680

664681
gocognit:
665682
# Minimal code complexity to report.
@@ -1354,18 +1371,31 @@ linters-settings:
13541371
# Allow local `replace` directives.
13551372
# Default: false
13561373
replace-local: true
1357-
13581374
# List of allowed `replace` directives.
13591375
# Default: []
13601376
replace-allow-list:
13611377
- launchpad.net/gocheck
13621378
# Allow to not explain why the version has been retracted in the `retract` directives.
13631379
# Default: false
13641380
retract-allow-no-explanation: true
1365-
13661381
# Forbid the use of the `exclude` directives.
13671382
# Default: false
13681383
exclude-forbidden: true
1384+
# Forbid the use of the `toolchain` directive.
1385+
# Default: false
1386+
toolchain-forbidden: true
1387+
# Defines a pattern to validate `toolchain` directive.
1388+
# Default: '' (no match)
1389+
toolchain-pattern: 'go1\.23\.\d+$'
1390+
# Forbid the use of the `tool` directives.
1391+
# Default: false
1392+
tool-forbidden: true
1393+
# Forbid the use of the `godebug` directive.
1394+
# Default: false
1395+
go-debug-forbidden: true
1396+
# Defines a pattern to validate `go` minimum version directive.
1397+
# Default: '' (no match)
1398+
go-version-pattern: '\d\.\d+(\.0)?'
13691399

13701400
gomodguard:
13711401
allowed:
@@ -1803,6 +1833,8 @@ linters-settings:
18031833
- sortslice
18041834
# Check signature of methods of well-known interfaces.
18051835
- stdmethods
1836+
# Check for uses of too-new standard library symbols.
1837+
- stdversion
18061838
# Check for string(int) conversions.
18071839
- stringintconv
18081840
# Check that struct field tags conform to reflect.StructTag.Get.
@@ -1823,6 +1855,8 @@ linters-settings:
18231855
- unusedresult
18241856
# Checks for unused writes.
18251857
- unusedwrite
1858+
# Checks for misuses of sync.WaitGroup.
1859+
- waitgroup
18261860

18271861
# Enable all analyzers.
18281862
# Default: false
@@ -1971,6 +2005,11 @@ linters-settings:
19712005
# see https://github.com/julz/importas#use-regular-expression for details
19722006
- pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+)
19732007
alias: $1$2
2008+
# An explicit empty alias can be used to ensure no aliases are used for a package.
2009+
# This can be useful if `no-extra-aliases: true` doesn't fit your need.
2010+
# Multiple packages can use an empty alias.
2011+
- pkg: errors
2012+
alias: ""
19742013

19752014
inamedparam:
19762015
# Skips check for interface methods with only a single parameter.
@@ -2034,6 +2073,9 @@ linters-settings:
20342073
# Allow check for the github.com/go-logr/logr library.
20352074
# Default: true
20362075
logr: false
2076+
# Allow check for the log/slog library.
2077+
# Default: true
2078+
slog: false
20372079
# Allow check for the "sugar logger" from go.uber.org/zap library.
20382080
# Default: true
20392081
zap: false
@@ -2280,6 +2322,23 @@ linters-settings:
22802322
patterns:
22812323
- ".*"
22822324

2325+
recvcheck:
2326+
# Disables the built-in method exclusions:
2327+
# - `MarshalText`
2328+
# - `MarshalJSON`
2329+
# - `MarshalYAML`
2330+
# - `MarshalXML`
2331+
# - `MarshalBinary`
2332+
# - `GobEncode`
2333+
# Default: false
2334+
disable-builtin: true
2335+
# User-defined method exclusions.
2336+
# The format is `struct_name.method_name` (ex: `Foo.MethodName`).
2337+
# A wildcard `*` can use as a struct name (ex: `*.MethodName`).
2338+
# Default: []
2339+
exclusions:
2340+
- "*.Value"
2341+
22832342
revive:
22842343
# Maximum number of open files at the same time.
22852344
# See https://github.com/mgechev/revive#command-line-flags
@@ -3280,16 +3339,24 @@ linters-settings:
32803339
strict: true
32813340

32823341
tagliatelle:
3283-
# Check the struct tag name case.
3342+
# Checks the struct tag name case.
32843343
case:
3285-
# Use the struct field name to check the name of the struct tag.
3286-
# Default: false
3287-
use-field-name: true
3288-
# `camel` is used for `json` and `yaml`, and `header` is used for `header` (can be overridden)
3289-
# Default: {}
3344+
# Defines the association between tag name and case.
3345+
# Any struct tag name can be used.
3346+
# Supported string cases:
3347+
# - `camel`
3348+
# - `pascal`
3349+
# - `kebab`
3350+
# - `snake`
3351+
# - `upperSnake`
3352+
# - `goCamel`
3353+
# - `goPascal`
3354+
# - `goKebab`
3355+
# - `goSnake`
3356+
# - `upper`
3357+
# - `lower`
3358+
# - `header`
32903359
rules:
3291-
# Any struct tag type can be used.
3292-
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
32933360
json: camel
32943361
yaml: camel
32953362
xml: camel
@@ -3299,6 +3366,70 @@ linters-settings:
32993366
mapstructure: kebab
33003367
env: upperSnake
33013368
envconfig: upperSnake
3369+
whatever: snake
3370+
# Defines the association between tag name and case.
3371+
# Important: the `extended-rules` overrides `rules`.
3372+
# Default: empty
3373+
extended-rules:
3374+
json:
3375+
# Supported string cases:
3376+
# - `camel`
3377+
# - `pascal`
3378+
# - `kebab`
3379+
# - `snake`
3380+
# - `upperSnake`
3381+
# - `goCamel`
3382+
# - `goPascal`
3383+
# - `goKebab`
3384+
# - `goSnake`
3385+
# - `header`
3386+
# - `lower`
3387+
# - `header`
3388+
#
3389+
# Required
3390+
case: camel
3391+
# Adds 'AMQP', 'DB', 'GID', 'RTP', 'SIP', 'TS' to initialisms,
3392+
# and removes 'LHS', 'RHS' from initialisms.
3393+
# Default: false
3394+
extra-initialisms: true
3395+
# Defines initialism additions and overrides.
3396+
# Default: empty
3397+
initialism-overrides:
3398+
DB: true # add a new initialism
3399+
LHS: false # disable a default initialism.
3400+
# ...
3401+
# Uses the struct field name to check the name of the struct tag.
3402+
# Default: false
3403+
use-field-name: true
3404+
# The field names to ignore.
3405+
# Default: []
3406+
ignored-fields:
3407+
- Bar
3408+
- Foo
3409+
# Overrides the default/root configuration.
3410+
# Default: []
3411+
overrides:
3412+
-
3413+
# The package path (uses `/` only as a separator).
3414+
# Required
3415+
pkg: foo/bar
3416+
# Default: empty or the same as the default/root configuration.
3417+
rules:
3418+
json: snake
3419+
xml: pascal
3420+
# Default: empty or the same as the default/root configuration.
3421+
extended-rules:
3422+
# Same options as the base `extended-rules`.
3423+
# Default: false (WARNING: it doesn't follow the default/root configuration)
3424+
use-field-name: true
3425+
# The field names to ignore.
3426+
# Default: [] or the same as the default/root configuration.
3427+
ignored-fields:
3428+
- Bar
3429+
- Foo
3430+
# Ignore the package (takes precedence over all other configurations).
3431+
# Default: false
3432+
ignore: true
33023433

33033434
tenv:
33043435
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
@@ -3490,6 +3621,38 @@ linters-settings:
34903621
# Default: false
34913622
constant-kind: true
34923623

3624+
usetesting:
3625+
# Enable/disable `os.CreateTemp("", ...)` detections.
3626+
# Default: true
3627+
os-create-temp: false
3628+
3629+
# Enable/disable `os.MkdirTemp()` detections.
3630+
# Default: true
3631+
os-mkdir-temp: false
3632+
3633+
# Enable/disable `os.Setenv()` detections.
3634+
# Default: false
3635+
os-setenv: true
3636+
3637+
# Enable/disable `os.TempDir()` detections.
3638+
# Default: false
3639+
os-temp-dir: true
3640+
3641+
# Enable/disable `os.Chdir()` detections.
3642+
# Disabled if Go < 1.24.
3643+
# Default: true
3644+
os-chdir: false
3645+
3646+
# Enable/disable `context.Background()` detections.
3647+
# Disabled if Go < 1.24.
3648+
# Default: true
3649+
context-background: false
3650+
3651+
# Enable/disable `context.TODO()` detections.
3652+
# Disabled if Go < 1.24.
3653+
# Default: true
3654+
context-todo: false
3655+
34933656
unconvert:
34943657
# Remove conversions that force intermediate rounding.
34953658
# Default: false
@@ -3586,6 +3749,15 @@ linters-settings:
35863749
multi-func: true
35873750

35883751
wrapcheck:
3752+
# An array of strings specifying additional substrings of signatures to ignore.
3753+
# Unlike 'ignoreSigs', this option extends the default set (or the set specified in 'ignoreSigs') without replacing it entirely.
3754+
# This allows you to add specific signatures to the ignore list
3755+
# while retaining the defaults or any items in 'ignoreSigs'.
3756+
# Default: []
3757+
extra-ignore-sigs:
3758+
- .CustomError(
3759+
- .SpecificWrap(
3760+
35893761
# An array of strings that specify substrings of signatures to ignore.
35903762
# If this set, it will override the default set of ignored signatures.
35913763
# See https://github.com/tomarrell/wrapcheck#configuration for more information.
@@ -3833,6 +4005,10 @@ issues:
38334005
# Default: 3
38344006
max-same-issues: 0
38354007

4008+
# Make issues output unique by line.
4009+
# Default: true
4010+
uniq-by-line: false
4011+
38364012
# Show only new issues: if there are unstaged changes or untracked files,
38374013
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
38384014
# It's a super-useful option for integration of golangci-lint into existing large codebase.
@@ -3902,10 +4078,6 @@ output:
39024078
# Default: true
39034079
print-linter-name: false
39044080

3905-
# Make issues output unique by line.
3906-
# Default: true
3907-
uniq-by-line: false
3908-
39094081
# Add a prefix to the output file references.
39104082
# Default: ""
39114083
path-prefix: ""
@@ -3940,6 +4112,7 @@ output:
39404112
# Options for analysis running.
39414113
run:
39424114
# Timeout for analysis, e.g. 30s, 5m.
4115+
# If the value is lower or equal to 0, the timeout is disabled.
39434116
# Default: 1m
39444117
timeout: 5m
39454118

.goreleaser.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ aur_sources:
190190
local _commit _flags
191191
_commit=$(bsdcat "${pkgname}-${pkgver}.tar.gz" | git get-tar-commit-id)
192192
_flags=(
193-
-X=main.version="$pkgver"
194-
-X=main.commit="${_commit::7}"
195-
-X=main.date="$(date -u -d "@${SOURCE_DATE_EPOCH}" +'%FT%TZ')"
196-
-linkmode=external
193+
-X=main.version="$pkgver"
194+
-X=main.commit="${_commit::7}"
195+
-X=main.date="$(date -u -d "@${SOURCE_DATE_EPOCH}" +'%FT%TZ')"
196+
-linkmode=external
197197
)
198198
export CGO_ENABLED=1
199199
export CGO_CFLAGS="${CFLAGS}"

0 commit comments

Comments
 (0)