@@ -72,6 +72,7 @@ output:
72
72
# - `junit-xml`
73
73
# - `github-actions`
74
74
# - `teamcity`
75
+ # - `sarif`
75
76
# Output path can be either `stdout`, `stderr` or path to the file to write to.
76
77
#
77
78
# For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma.
@@ -1388,14 +1389,16 @@ linters-settings:
1388
1389
min-complexity : 4
1389
1390
1390
1391
nilnil :
1391
- # Checks that there is no simultaneous return of `nil` error and an invalid value .
1392
- # Default: ["ptr", "func", "iface", "map", "chan"]
1392
+ # List of return types to check .
1393
+ # Default: ["ptr", "func", "iface", "map", "chan", "uintptr", "unsafeptr" ]
1393
1394
checked-types :
1394
1395
- ptr
1395
1396
- func
1396
1397
- iface
1397
1398
- map
1398
1399
- chan
1400
+ - uintptr
1401
+ - unsafeptr
1399
1402
1400
1403
nlreturn :
1401
1404
# Size of the block (including return statement that is still "OK")
@@ -1996,39 +1999,56 @@ linters-settings:
1996
1999
1997
2000
sloglint :
1998
2001
# Enforce not mixing key-value pairs and attributes.
2002
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-mixed-arguments
1999
2003
# Default: true
2000
2004
no-mixed-args : false
2001
2005
# Enforce using key-value pairs only (overrides no-mixed-args, incompatible with attr-only).
2006
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-value-pairs-only
2002
2007
# Default: false
2003
2008
kv-only : true
2004
2009
# Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only).
2010
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#attributes-only
2005
2011
# Default: false
2006
2012
attr-only : true
2007
2013
# Enforce not using global loggers.
2008
2014
# Values:
2009
2015
# - "": disabled
2010
2016
# - "all": report all global loggers
2011
2017
# - "default": report only the default slog logger
2018
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-global
2012
2019
# Default: ""
2013
2020
no-global : " all"
2014
2021
# Enforce using methods that accept a context.
2015
2022
# Values:
2016
2023
# - "": disabled
2017
2024
# - "all": report all contextless calls
2018
2025
# - "scope": report only if a context exists in the scope of the outermost function
2026
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#context-only
2019
2027
# Default: ""
2020
2028
context : " all"
2021
2029
# Enforce using static values for log messages.
2030
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#static-messages
2022
2031
# Default: false
2023
2032
static-msg : true
2024
2033
# Enforce using constants instead of raw keys.
2034
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-raw-keys
2025
2035
# Default: false
2026
2036
no-raw-keys : true
2027
2037
# Enforce a single key naming convention.
2028
2038
# Values: snake, kebab, camel, pascal
2039
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-naming-convention
2029
2040
# Default: ""
2030
2041
key-naming-case : snake
2042
+ # Enforce not using specific keys.
2043
+ # Default: []
2044
+ forbidden-keys :
2045
+ - time
2046
+ - level
2047
+ - msg
2048
+ - source
2049
+ - foo
2031
2050
# Enforce putting arguments on separate lines.
2051
+ # https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys
2032
2052
# Default: false
2033
2053
args-on-sep-lines : true
2034
2054
@@ -2158,9 +2178,10 @@ linters-settings:
2158
2178
- error-is-as
2159
2179
- error-nil
2160
2180
- expected-actual
2161
- - go-require
2162
2181
- float-compare
2182
+ - go-require
2163
2183
- len
2184
+ - negative-positive
2164
2185
- nil-compare
2165
2186
- require-error
2166
2187
- suite-dont-use-pkg
@@ -2174,7 +2195,7 @@ linters-settings:
2174
2195
# Enable checkers by name
2175
2196
# (in addition to default
2176
2197
# blank-import, bool-compare, compares, empty, error-is-as, error-nil, expected-actual, go-require, float-compare,
2177
- # len, nil-compare, require-error, suite-dont-use-pkg, suite-extra-assert-call, useless-assert
2198
+ # len, negative-positive, nil-compare, require-error, suite-dont-use-pkg, suite-extra-assert-call, useless-assert
2178
2199
# ).
2179
2200
enable :
2180
2201
- blank-import
@@ -2184,9 +2205,10 @@ linters-settings:
2184
2205
- error-is-as
2185
2206
- error-nil
2186
2207
- expected-actual
2187
- - go-require
2188
2208
- float-compare
2209
+ - go-require
2189
2210
- len
2211
+ - negative-positive
2190
2212
- nil-compare
2191
2213
- require-error
2192
2214
- suite-dont-use-pkg
@@ -2202,6 +2224,10 @@ linters-settings:
2202
2224
# Regexp for expected variable name.
2203
2225
# Default: (^(exp(ected)?|want(ed)?)([A-Z]\w*)?$)|(^(\w*[a-z])?(Exp(ected)?|Want(ed)?)$)
2204
2226
pattern : ^expected
2227
+ go-require :
2228
+ # To ignore HTTP handlers (like http.HandlerFunc).
2229
+ # Default: false
2230
+ ignore-http-handlers : true
2205
2231
require-error :
2206
2232
# Regexp for assertions to analyze. If defined, then only matched error assertions will be reported.
2207
2233
# Default: ""
@@ -2846,17 +2872,17 @@ issues:
2846
2872
- " .*\\ .my\\ .go$"
2847
2873
- lib/bad.go
2848
2874
2849
- # To follow strictly the Go generated file convention .
2875
+ # Mode of the generated files analysis .
2850
2876
#
2851
- # If set to true, source files that have lines matching only the following regular expression will be excluded:
2852
- # `^// Code generated .* DO NOT EDIT\.$`
2853
- # This line must appear before the first non-comment, non-blank text in the file.
2854
- # https://go.dev/s/generatedcode
2877
+ # - `strict`: sources are excluded by following strictly the Go generated file convention.
2878
+ # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$`
2879
+ # This line must appear before the first non-comment, non-blank text in the file.
2880
+ # https://go.dev/s/generatedcode
2881
+ # - `lax`: sources are excluded if they contain lines `autogenerated file`, `code generated`, `do not edit`, etc.
2882
+ # - `disable`: disable the generated files exclusion.
2855
2883
#
2856
- # By default, a lax pattern is applied:
2857
- # sources are excluded if they contain lines `autogenerated file`, `code generated`, `do not edit`, etc.
2858
- # Default: false
2859
- exclude-generated-strict : true
2884
+ # Default: lax
2885
+ exclude-generated : strict
2860
2886
2861
2887
# The list of ids of default excludes to include or disable.
2862
2888
# https://golangci-lint.run/usage/false-positives/#default-exclusions
0 commit comments