@@ -154,9 +154,9 @@ linters-settings:
154
154
pop-directional-isolate : false
155
155
156
156
copyloopvar :
157
- # If true, ignore aliasing of loop variables .
157
+ # Check all assigning the loop variable to another variable .
158
158
# Default: false
159
- ignore -alias : true
159
+ check -alias : true
160
160
161
161
cyclop :
162
162
# The maximal code complexity to report.
@@ -279,23 +279,11 @@ linters-settings:
279
279
# Default: false
280
280
check-blank : true
281
281
282
- # DEPRECATED comma-separated list of pairs of the form pkg:regex
283
- #
284
- # the regex is used to ignore names within pkg. (default "fmt:.*").
285
- # see https://github.com/kisielk/errcheck#the-deprecated-method for details
286
- ignore : fmt:.*,io/ioutil:^Read.*
287
-
288
282
# To disable the errcheck built-in exclude list.
289
283
# See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details.
290
284
# Default: false
291
285
disable-default-exclusions : true
292
286
293
- # DEPRECATED use exclude-functions instead.
294
- #
295
- # Path to a file containing a list of functions to exclude from checking.
296
- # See https://github.com/kisielk/errcheck#excluding-functions for details.
297
- exclude : /path/to/file.txt
298
-
299
287
# List of functions to exclude from checking, where each entry is a single function to exclude.
300
288
# See https://github.com/kisielk/errcheck#excluding-functions for details.
301
289
exclude-functions :
@@ -338,6 +326,16 @@ linters-settings:
338
326
# Check for plain error comparisons.
339
327
# Default: true
340
328
comparison : false
329
+ # Allowed errors.
330
+ # Default: []
331
+ allowed-errors :
332
+ - err : " io.EOF"
333
+ fun : " example.com/pkg.Read"
334
+ # Allowed error "wildcards".
335
+ # Default: []
336
+ allowed-errors-wildcard :
337
+ - err : " example.com/pkg.ErrMagic"
338
+ fun : " example.com/pkg.Magic"
341
339
342
340
exhaustive :
343
341
# Program elements to check for exhaustiveness.
@@ -431,12 +429,9 @@ linters-settings:
431
429
ignore-comments : true
432
430
433
431
gci :
434
- # DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead.
435
- local-prefixes : github.com/org/project
436
-
437
432
# Section configuration to compare against.
438
433
# Section names are case-insensitive and may contain parameters in ().
439
- # The default order of sections is `standard > default > custom > blank > dot > alias`,
434
+ # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule `,
440
435
# If `custom-order` is `true`, it follows the order of `sections` option.
441
436
# Default: ["standard", "default"]
442
437
sections :
@@ -446,6 +441,7 @@ linters-settings:
446
441
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
447
442
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
448
443
- alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
444
+ - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
449
445
450
446
# Skip generated files.
451
447
# Default: true
@@ -636,17 +632,14 @@ linters-settings:
636
632
# The option is passed to the ruleguard 'debug-group' argument.
637
633
# Default: ""
638
634
debug : ' emptyDecl'
639
- # Deprecated, use 'failOn' param.
640
- # If set to true, identical to failOn='all', otherwise failOn=''
641
- failOnError : false
642
635
# Determines the behavior when an error occurs while parsing ruleguard files.
643
636
# If flag is not set, log error and skip rule files that contain an error.
644
637
# If flag is set, the value must be a comma-separated list of error conditions.
645
638
# - 'all': fail on all errors.
646
639
# - 'import': ruleguard rule imports a package that cannot be found.
647
640
# - 'dsl': gorule file does not comply with the ruleguard DSL.
648
641
# Default: ""
649
- failOn : dsl
642
+ failOn : dsl,import
650
643
# Comma-separated list of file paths containing ruleguard rules.
651
644
# If a path is relative, it is relative to the directory where the golangci-lint command is executed.
652
645
# The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file.
@@ -723,9 +716,6 @@ linters-settings:
723
716
replacement : ' a[b:]'
724
717
725
718
gofumpt :
726
- # Deprecated: use the global `run.go` instead.
727
- lang-version : " 1.17"
728
-
729
719
# Module path which contains the source code being formatted.
730
720
# Default: ""
731
721
module-path : github.com/org/project
@@ -779,38 +769,6 @@ linters-settings:
779
769
# Default: ""
780
770
local-prefixes : github.com/org/project
781
771
782
- gomnd :
783
- # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
784
- # Default: ["argument", "case", "condition", "operation", "return", "assign"]
785
- checks :
786
- - argument
787
- - case
788
- - condition
789
- - operation
790
- - return
791
- - assign
792
- # List of numbers to exclude from analysis.
793
- # The numbers should be written as string.
794
- # Values always ignored: "1", "1.0", "0" and "0.0"
795
- # Default: []
796
- ignored-numbers :
797
- - ' 0666'
798
- - ' 0755'
799
- - ' 42'
800
- # List of file patterns to exclude from analysis.
801
- # Values always ignored: `.+_test.go`
802
- # Default: []
803
- ignored-files :
804
- - ' magic1_.+\.go$'
805
- # List of function patterns to exclude from analysis.
806
- # Following functions are always ignored: `time.Date`,
807
- # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
808
- # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
809
- # Default: []
810
- ignored-functions :
811
- - ' ^math\.'
812
- - ' ^http\.StatusText$'
813
-
814
772
gomoddirectives :
815
773
# Allow local `replace` directives.
816
774
# Default: false
@@ -861,8 +819,6 @@ linters-settings:
861
819
local_replace_directives : false
862
820
863
821
gosimple :
864
- # Deprecated: use the global `run.go` instead.
865
- go : " 1.15"
866
822
# Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
867
823
# Default: ["*"]
868
824
checks : [ "all" ]
@@ -1367,6 +1323,38 @@ linters-settings:
1367
1323
# Default: ""
1368
1324
mode : restricted
1369
1325
1326
+ mnd :
1327
+ # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
1328
+ # Default: ["argument", "case", "condition", "operation", "return", "assign"]
1329
+ checks :
1330
+ - argument
1331
+ - case
1332
+ - condition
1333
+ - operation
1334
+ - return
1335
+ - assign
1336
+ # List of numbers to exclude from analysis.
1337
+ # The numbers should be written as string.
1338
+ # Values always ignored: "1", "1.0", "0" and "0.0"
1339
+ # Default: []
1340
+ ignored-numbers :
1341
+ - ' 0666'
1342
+ - ' 0755'
1343
+ - ' 42'
1344
+ # List of file patterns to exclude from analysis.
1345
+ # Values always ignored: `.+_test.go`
1346
+ # Default: []
1347
+ ignored-files :
1348
+ - ' magic1_.+\.go$'
1349
+ # List of function patterns to exclude from analysis.
1350
+ # Following functions are always ignored: `time.Date`,
1351
+ # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
1352
+ # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
1353
+ # Default: []
1354
+ ignored-functions :
1355
+ - ' ^math\.'
1356
+ - ' ^http\.StatusText$'
1357
+
1370
1358
musttag :
1371
1359
# A set of custom functions to check in addition to the builtin ones.
1372
1360
# Default: json, xml, gopkg.in/yaml.v3, BurntSushi/toml, mitchellh/mapstructure, jmoiron/sqlx
@@ -2013,8 +2001,12 @@ linters-settings:
2013
2001
# Default: ""
2014
2002
no-global : " all"
2015
2003
# Enforce using methods that accept a context.
2016
- # Default: false
2017
- context-only : true
2004
+ # Values:
2005
+ # - "": disabled
2006
+ # - "all": report all contextless calls
2007
+ # - "scope": report only if a context exists in the scope of the outermost function
2008
+ # Default: ""
2009
+ context : " all"
2018
2010
# Enforce using static values for log messages.
2019
2011
# Default: false
2020
2012
static-msg : true
@@ -2046,17 +2038,19 @@ linters-settings:
2046
2038
# Default: []
2047
2039
ignore-check-signatures :
2048
2040
- " telemetry.RecordError"
2049
-
2041
+ # A list of regexes for additional function signatures that create spans.
2042
+ # This is useful if you have a utility method to create spans.
2043
+ # Each entry should be of the form `<regex>:<telemetry-type>`, where `telemetry-type` can be `opentelemetry` or `opencensus`.
2044
+ # https://github.com/jjti/go-spancheck#extra-start-span-signatures
2045
+ # Default: []
2046
+ extra-start-span-signatures :
2047
+ - " github.com/user/repo/telemetry/trace.Start:opentelemetry"
2050
2048
staticcheck :
2051
- # Deprecated: use the global `run.go` instead.
2052
- go : " 1.15"
2053
2049
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
2054
2050
# Default: ["*"]
2055
2051
checks : [ "all" ]
2056
2052
2057
2053
stylecheck :
2058
- # Deprecated: use the global `run.go` instead.
2059
- go : " 1.15"
2060
2054
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
2061
2055
# Default: ["*"]
2062
2056
checks : [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
@@ -2280,9 +2274,6 @@ linters-settings:
2280
2274
# Suggest the use of rpc.DefaultXXPath.
2281
2275
# Default: false
2282
2276
default-rpc-path : true
2283
- # DEPRECATED Suggest the use of os.DevNull.
2284
- # Default: false
2285
- os-dev-null : true
2286
2277
# Suggest the use of sql.LevelXX.String().
2287
2278
# Default: false
2288
2279
sql-isolation-level : true
@@ -2292,9 +2283,6 @@ linters-settings:
2292
2283
# Suggest the use of constant.Kind.String().
2293
2284
# Default: false
2294
2285
constant-kind : true
2295
- # DEPRECATED Suggest the use of syslog.Priority.
2296
- # Default: false
2297
- syslog-priority : true
2298
2286
2299
2287
unconvert :
2300
2288
# Remove conversions that force intermediate rounding.
@@ -2514,6 +2502,7 @@ linters:
2514
2502
- asciicheck
2515
2503
- bidichk
2516
2504
- bodyclose
2505
+ - canonicalheader
2517
2506
- containedctx
2518
2507
- contextcheck
2519
2508
- copyloopvar
@@ -2524,6 +2513,7 @@ linters:
2524
2513
- dupl
2525
2514
- dupword
2526
2515
- durationcheck
2516
+ - err113
2527
2517
- errcheck
2528
2518
- errchkjson
2529
2519
- errname
@@ -2532,6 +2522,7 @@ linters:
2532
2522
- exhaustive
2533
2523
- exhaustruct
2534
2524
- exportloopref
2525
+ - fatcontext
2535
2526
- forbidigo
2536
2527
- forcetypeassert
2537
2528
- funlen
@@ -2547,12 +2538,10 @@ linters:
2547
2538
- gocyclo
2548
2539
- godot
2549
2540
- godox
2550
- - goerr113
2551
2541
- gofmt
2552
2542
- gofumpt
2553
2543
- goheader
2554
2544
- goimports
2555
- - gomnd
2556
2545
- gomoddirectives
2557
2546
- gomodguard
2558
2547
- goprintffuncname
@@ -2573,6 +2562,7 @@ linters:
2573
2562
- makezero
2574
2563
- mirror
2575
2564
- misspell
2565
+ - mnd
2576
2566
- musttag
2577
2567
- nakedret
2578
2568
- nestif
@@ -2627,6 +2617,7 @@ linters:
2627
2617
- asciicheck
2628
2618
- bidichk
2629
2619
- bodyclose
2620
+ - canonicalheader
2630
2621
- containedctx
2631
2622
- contextcheck
2632
2623
- copyloopvar
@@ -2637,6 +2628,7 @@ linters:
2637
2628
- dupl
2638
2629
- dupword
2639
2630
- durationcheck
2631
+ - err113
2640
2632
- errcheck
2641
2633
- errchkjson
2642
2634
- errname
@@ -2645,6 +2637,7 @@ linters:
2645
2637
- exhaustive
2646
2638
- exhaustruct
2647
2639
- exportloopref
2640
+ - fatcontext
2648
2641
- forbidigo
2649
2642
- forcetypeassert
2650
2643
- funlen
@@ -2660,12 +2653,10 @@ linters:
2660
2653
- gocyclo
2661
2654
- godot
2662
2655
- godox
2663
- - goerr113
2664
2656
- gofmt
2665
2657
- gofumpt
2666
2658
- goheader
2667
2659
- goimports
2668
- - gomnd
2669
2660
- gomoddirectives
2670
2661
- gomodguard
2671
2662
- goprintffuncname
@@ -2686,6 +2677,7 @@ linters:
2686
2677
- makezero
2687
2678
- mirror
2688
2679
- misspell
2680
+ - mnd
2689
2681
- musttag
2690
2682
- nakedret
2691
2683
- nestif
@@ -2735,6 +2727,7 @@ linters:
2735
2727
- ifshort # Deprecated
2736
2728
- interfacer # Deprecated
2737
2729
- maligned # Deprecated
2730
+ - gomnd # Deprecated
2738
2731
- nosnakecase # Deprecated
2739
2732
- scopelint # Deprecated
2740
2733
- structcheck # Deprecated
0 commit comments