Skip to content

Commit 65529a4

Browse files
docs: update documentation assets (#5903)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 1e7781b commit 65529a4

8 files changed

+344
-31
lines changed

.golangci.reference.yml

Lines changed: 147 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ linters:
2020

2121
# Enable specific linter.
2222
enable:
23+
- arangolint
2324
- asasalint
2425
- asciicheck
2526
- bidichk
@@ -35,6 +36,7 @@ linters:
3536
- dupl
3637
- dupword
3738
- durationcheck
39+
- embeddedstructfieldcheck
3840
- err113
3941
- errcheck
4042
- errchkjson
@@ -89,6 +91,7 @@ linters:
8991
- nilnil
9092
- nlreturn
9193
- noctx
94+
- noinlineerr
9295
- nolintlint
9396
- nonamedreturns
9497
- nosprintfhostport
@@ -123,10 +126,12 @@ linters:
123126
- whitespace
124127
- wrapcheck
125128
- wsl
129+
- wsl_v5
126130
- zerologlint
127131

128-
# Disable specific linter.
132+
# Disable specific linters.
129133
disable:
134+
- arangolint
130135
- asasalint
131136
- asciicheck
132137
- bidichk
@@ -142,6 +147,7 @@ linters:
142147
- dupl
143148
- dupword
144149
- durationcheck
150+
- embeddedstructfieldcheck
145151
- err113
146152
- errcheck
147153
- errchkjson
@@ -196,6 +202,7 @@ linters:
196202
- nilnil
197203
- nlreturn
198204
- noctx
205+
- noinlineerr
199206
- nolintlint
200207
- nonamedreturns
201208
- nosprintfhostport
@@ -230,6 +237,7 @@ linters:
230237
- whitespace
231238
- wrapcheck
232239
- wsl
240+
- wsl_v5
233241
- zerologlint
234242

235243
# All available settings of specific linters.
@@ -383,6 +391,11 @@ linters:
383391
ignore:
384392
- "0C0C"
385393

394+
embeddedstructfieldcheck:
395+
# Checks that sync.Mutex and sync.RWMutex are not used as embedded fields.
396+
# Default: false
397+
forbid-mutex: true
398+
386399
errcheck:
387400
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
388401
# Such cases aren't reported by default.
@@ -406,6 +419,10 @@ linters:
406419
- io.Copy(*bytes.Buffer)
407420
- io.Copy(os.Stdout)
408421

422+
# Display function signature instead of selector.
423+
# Default: false
424+
verbose: true
425+
409426
errchkjson:
410427
# With check-error-free-encoding set to true, errchkjson does warn about errors
411428
# from json encoding functions that are safe to be ignored,
@@ -541,6 +558,9 @@ linters:
541558
# Checks if the exported methods of a structure are placed before the non-exported ones.
542559
# Default: true
543560
struct-method: false
561+
# Checks if the constructors and/or structure methods are sorted alphabetically.
562+
# Default: false
563+
alphabetical: true
544564

545565
funlen:
546566
# Checks the number of lines in a function.
@@ -1295,6 +1315,9 @@ linters:
12951315
# Forbid the use of the `exclude` directives.
12961316
# Default: false
12971317
exclude-forbidden: true
1318+
# Forbid the use of the `ignore` directives (>= go1.25).
1319+
# Default: false
1320+
ignore-forbidden: true
12981321
# Forbid the use of the `toolchain` directive.
12991322
# Default: false
13001323
toolchain-forbidden: true
@@ -1599,6 +1622,8 @@ linters:
15991622
- findcall
16001623
# Report assembly that clobbers the frame pointer before saving it.
16011624
- framepointer
1625+
# Check format of addresses passed to net.Dial.
1626+
- hostport
16021627
# Report using Go 1.22 enhanced ServeMux patterns in older Go versions.
16031628
- httpmux
16041629
# Check for mistakes using HTTP responses.
@@ -1682,6 +1707,7 @@ linters:
16821707
- fieldalignment
16831708
- findcall
16841709
- framepointer
1710+
- hostport
16851711
- httpmux
16861712
- httpresponse
16871713
- ifaceassert
@@ -1776,6 +1802,7 @@ linters:
17761802
- identical # Identifies interfaces in the same package that have identical method sets.
17771803
- unused # Identifies interfaces that are not used anywhere in the same package where the interface is defined.
17781804
- opaque # Identifies functions that return interfaces, but the actual returned value is always a single concrete implementation.
1805+
- unexported # Identifies interfaces that are not exported but are used in exported functions or methods.
17791806
settings:
17801807
unused:
17811808
# List of packages path to exclude from the check.
@@ -2302,11 +2329,12 @@ linters:
23022329
disabled: false
23032330
exclude: [""]
23042331
arguments:
2305-
- - "call-chain"
2306-
- "loop"
2307-
- "method-call"
2308-
- "recover"
2309-
- "return"
2332+
- "call-chain"
2333+
- "loop"
2334+
- "method-call"
2335+
- "recover"
2336+
- "immediate-recover"
2337+
- "return"
23102338
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#dot-imports
23112339
- name: dot-imports
23122340
severity: warning
@@ -2568,7 +2596,7 @@ linters:
25682596
severity: warning
25692597
disabled: false
25702598
exclude: [""]
2571-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-test-main-exit
2599+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-test-main-exit
25722600
- name: redundant-test-main-exit
25732601
severity: warning
25742602
disabled: false
@@ -2608,6 +2636,11 @@ linters:
26082636
exclude: [""]
26092637
arguments:
26102638
- "preserve-scope"
2639+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-date
2640+
- name: time-date
2641+
severity: warning
2642+
disabled: false
2643+
exclude: [""]
26112644
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-equal
26122645
- name: time-equal
26132646
severity: warning
@@ -2648,6 +2681,11 @@ linters:
26482681
arguments:
26492682
- "fmt.Printf"
26502683
- "myFunction"
2684+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-format
2685+
- name: unnecessary-format
2686+
severity: warning
2687+
disabled: false
2688+
exclude: [""]
26512689
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-stmt
26522690
- name: unnecessary-stmt
26532691
severity: warning
@@ -2682,6 +2720,11 @@ linters:
26822720
severity: warning
26832721
disabled: false
26842722
exclude: [""]
2723+
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-fmt-print
2724+
- name: use-fmt-print
2725+
severity: warning
2726+
disabled: false
2727+
exclude: [""]
26852728
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break
26862729
- name: useless-break
26872730
severity: warning
@@ -2812,6 +2855,7 @@ linters:
28122855
http-status-code-whitelist: [ "200", "400", "404", "500" ]
28132856
# SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks
28142857
# Example (to disable some checks): [ "all", "-SA1000", "-SA1001"]
2858+
# Run `GL_DEBUG=staticcheck golangci-lint run --enable=staticcheck` to see all available checks and enabled by config checks.
28152859
# Default: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
28162860
checks:
28172861
# Invalid regular expression.
@@ -3595,6 +3639,9 @@ linters:
35953639
# Suggest the use of http.StatusXX.
35963640
# Default: true
35973641
http-status-code: false
3642+
# Suggest the use of time.Month in time.Date.
3643+
# Default: false
3644+
time-date-month: true
35983645
# Suggest the use of time.Weekday.String().
35993646
# Default: true
36003647
time-weekday: true
@@ -3644,13 +3691,13 @@ linters:
36443691

36453692
# Enable/disable `context.Background()` detections.
36463693
# Disabled if Go < 1.24.
3647-
# Default: true
3648-
context-background: false
3694+
# Default: false
3695+
context-background: true
36493696

36503697
# Enable/disable `context.TODO()` detections.
36513698
# Disabled if Go < 1.24.
3652-
# Default: true
3653-
context-todo: false
3699+
# Default: false
3700+
context-todo: true
36543701

36553702
unconvert:
36563703
# Remove conversions that force intermediate rounding.
@@ -3867,6 +3914,93 @@ linters:
38673914
# Default: false
38683915
force-short-decl-cuddling: true
38693916

3917+
wsl_v5:
3918+
# Allow cuddling a variable if it's used first in the immediate following block,
3919+
# even if the statement with the block doesn't use the variable.
3920+
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
3921+
# Default: true
3922+
allow-first-in-block: false
3923+
3924+
# Same as above,
3925+
# but allows cuddling if the variable is used anywhere in the following (or nested) block.
3926+
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
3927+
# Default: false
3928+
allow-whole-block: true
3929+
3930+
# If a block contains more than this number of lines,
3931+
# the branch statement needs to be separated by whitespace.
3932+
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
3933+
# Default: 2
3934+
branch-max-lines: 4
3935+
3936+
# If set to a non-negative number,
3937+
# case blocks need to end with whitespace if exceeding this number
3938+
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration
3939+
# Default: 0
3940+
case-max-lines: 2
3941+
3942+
# Default checks to use.
3943+
# Can be `all`, `none`, `default` or empty.
3944+
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
3945+
# Default: ""
3946+
default: all
3947+
3948+
# Enabled checks.
3949+
# Will be additive to any presets.
3950+
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
3951+
# Default: []
3952+
enable:
3953+
- assign
3954+
- branch
3955+
- decl
3956+
- defer
3957+
- expr
3958+
- for
3959+
- go
3960+
- if
3961+
- inc-dec
3962+
- label
3963+
- range
3964+
- return
3965+
- select
3966+
- send
3967+
- switch
3968+
- type-switch
3969+
- append
3970+
- assign-exclusive
3971+
- assign-expr
3972+
- err
3973+
- leading-whitespace
3974+
- trailing-whitespace
3975+
3976+
# Disable checks.
3977+
# Will be subtractive to any preset.
3978+
# https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration
3979+
# Default: []
3980+
disable:
3981+
- assign
3982+
- branch
3983+
- decl
3984+
- defer
3985+
- expr
3986+
- for
3987+
- go
3988+
- if
3989+
- inc-dec
3990+
- label
3991+
- range
3992+
- return
3993+
- select
3994+
- send
3995+
- switch
3996+
- type-switch
3997+
- append
3998+
- assign-exclusive
3999+
- assign-expr
4000+
- err
4001+
- leading-whitespace
4002+
- trailing-whitespace
4003+
38704004
# The custom section can be used to define linter plugins to be loaded at runtime.
38714005
# See README documentation for more info.
38724006
custom:
@@ -3970,6 +4104,7 @@ formatters:
39704104
- gofumpt
39714105
- goimports
39724106
- golines
4107+
- swaggo
39734108

39744109
# Formatters settings.
39754110
settings:
@@ -4066,6 +4201,7 @@ formatters:
40664201
# Default: lax
40674202
generated: strict
40684203
# Which file paths to exclude.
4204+
# This option is ignored when using `--stdin` as the path is unknown.
40694205
# Default: []
40704206
paths:
40714207
- ".*\\.my\\.go$"

0 commit comments

Comments
 (0)