4747 - " .*\\ .my\\ .go$"
4848 - lib/bad.go
4949
50- # By default, it isn't set.
5150 # If set we pass it to "go list -mod={option}". From "go help modules":
5251 # If invoked with -mod=readonly, the go command is disallowed from the implicit
5352 # automatic updating of go.mod described above. Instead, it fails when any changes
5655 # If invoked with -mod=vendor, the go command assumes that the vendor
5756 # directory holds the correct copies of dependencies and ignores
5857 # the dependency descriptions in go.mod.
59- modules-download-mode : readonly|vendor|mod
58+ #
59+ # Allowed values: readonly|vendor|mod
60+ # By default, it isn't set.
61+ modules-download-mode : readonly
6062
6163 # Allow multiple parallel golangci-lint instances running.
6264 # If false (default) - golangci-lint acquires file lock on start.
@@ -143,13 +145,26 @@ linters-settings:
143145 disable-dec-num-check : false
144146
145147 depguard :
146- list-type : denylist
147- include-go-root : false
148+ # Kind of list is passed in.
149+ # Allowed values: allowlist|denylist
150+ # Default: denylist
151+ list-type : allowlist
152+
153+ # Check the list against standard lib.
154+ # Default: false
155+ include-go-root : true
156+
157+ # A list of packages for the list type specified.
158+ # Default: []
148159 packages :
149160 - github.com/sirupsen/logrus
161+
162+ # A list of packages for the list type specified.
163+ # Specify an error message to output when a denied package is used.
164+ # Default: []
150165 packages-with-error-message :
151- # Specify an error message to output when a denied package is used.
152166 - github.com/sirupsen/logrus : ' logging is allowed only by logutils.Log'
167+
153168 # Create additional guards that follow the same configuration pattern.
154169 # Results from all guards are aggregated together.
155170 additional-guards :
@@ -226,23 +241,30 @@ linters-settings:
226241 errorlint :
227242 # Check whether fmt.Errorf uses the %w verb for formatting errors.
228243 # See the https://github.com/polyfloyd/go-errorlint for caveats.
229- errorf : true
244+ # Default: true
245+ errorf : false
230246 # Check for plain type assertions and type switches.
231- asserts : true
247+ # Default: true
248+ asserts : false
232249 # Check for plain error comparisons.
233- comparison : true
250+ # Default: true
251+ comparison : false
234252
235253 exhaustive :
236254 # Check switch statements in generated files also.
237- check-generated : false
255+ # Default: false
256+ check-generated : true
238257 # Presence of "default" case in switch statements satisfies exhaustiveness,
239258 # even if all enum members are not listed.
240- default-signifies-exhaustive : false
259+ # Default: false
260+ default-signifies-exhaustive : true
241261 # Enum members matching the supplied regex do not have to be listed in
242262 # switch statements to satisfy exhaustiveness.
243- ignore-enum-members : " "
263+ # Default: ""
264+ ignore-enum-members : " Example.+"
244265 # Consider enums only in package scopes, not in inner scopes.
245- package-scope-only : false
266+ # Default: false
267+ package-scope-only : true
246268
247269 exhaustivestruct :
248270 # Struct Patterns is list of expressions to match struct packages and names.
@@ -263,8 +285,14 @@ linters-settings:
263285 exclude_godoc_examples : false
264286
265287 funlen :
266- lines : 60
267- statements : 40
288+ # Checks the number of lines in a function.
289+ # If lower than 0, disable the check.
290+ # Default: 60
291+ lines : -1
292+ # Checks the number of statements in a function.
293+ # If lower than 0, disable the check.
294+ # Default: 40
295+ statements : -1
268296
269297 gci :
270298 # Put imports beginning with prefix after 3rd-party packages.
@@ -274,7 +302,7 @@ linters-settings:
274302
275303 gocognit :
276304 # Minimal code complexity to report
277- # Default: 30, (but we recommend 10-20)
305+ # Default: 30 (but we recommend 10-20)
278306 min-complexity : 10
279307
280308 goconst :
@@ -323,9 +351,17 @@ linters-settings:
323351 # See https://github.com/go-critic/go-critic#usage -> section "Tags".
324352 # Default: []
325353 enabled-tags :
354+ - diagnostic
355+ - style
326356 - performance
357+ - experimental
358+ - opinionated
327359 disabled-tags :
360+ - diagnostic
361+ - style
362+ - performance
328363 - experimental
364+ - opinionated
329365
330366 # Settings passed to gocritic.
331367 # The settings key is the name of a supported gocritic checker.
@@ -408,7 +444,7 @@ linters-settings:
408444
409445 gocyclo :
410446 # Minimal code complexity to report.
411- # Default: 30, (but we recommend 10-20)
447+ # Default: 30 (but we recommend 10-20)
412448 min-complexity : 10
413449
414450 godot :
@@ -444,23 +480,26 @@ linters-settings:
444480 gofumpt :
445481 # Select the Go version to target.
446482 # Default: 1.15
447- lang-version : " 1.15 "
483+ lang-version : " 1.17 "
448484
449485 # Choose whether to use the extra rules.
450486 # Default: false
451487 extra-rules : true
452488
453489 goheader :
490+ # Supports two types 'const` and `regexp`.
491+ # Values can be used recursively.
454492 values :
455493 const :
456494 # Define here const type values in format k:v.
457495 # For example:
458- # COMPANY: MY COMPANY
496+ COMPANY : MY COMPANY
459497 regexp :
460498 # Define here regexp type values.
461499 # for example:
462- # AUTHOR: .*@mycompany\.com
463- template : # |-
500+ AUTHOR : .*@mycompany\.com
501+ # The template use for checking.
502+ template : |-
464503 # Put here copyright header template for source code files
465504 # For example:
466505 # Note: {{ YEAR }} is a builtin value that returns the year relative to the current machine time.
@@ -479,8 +518,9 @@ linters-settings:
479518 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
480519 # See the License for the specific language governing permissions and
481520 # limitations under the License.
482- template-path :
483- # Also, as alternative of directive 'template' you may put the path to file with the template source.
521+ # As alternative of directive 'template', you may put the path to file with the template source.
522+ # Useful if you need to load the template from a specific file.
523+ template-path : /path/to/my/template.tmpl
484524
485525 goimports :
486526 # Put imports beginning with prefix after 3rd-party packages.
@@ -575,18 +615,26 @@ linters-settings:
575615 - G401
576616 - G306
577617 - G101
618+
578619 # To specify a set of rules to explicitly exclude.
579620 # Available rules: https://github.com/securego/gosec#available-rules
580621 excludes :
581622 - G204
623+
582624 # Exclude generated files
625+ # Default: false
583626 exclude-generated : true
627+
584628 # Filter out the issues with a lower severity than the given value.
585629 # Valid options are: low, medium, high.
586- severity : " low"
630+ # Default: low
631+ severity : medium
632+
587633 # Filter out the issues with a lower confidence than the given value.
588634 # Valid options are: low, medium, high.
589- confidence : " low"
635+ # Default: low
636+ confidence : medium
637+
590638 # To specify the configuration of rules.
591639 # The configuration of rules is not fully documented by gosec:
592640 # https://github.com/securego/gosec#configuration
@@ -705,9 +753,11 @@ linters-settings:
705753 ifshort :
706754 # Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax.
707755 # Has higher priority than max-decl-chars.
708- max-decl-lines : 1
756+ # Default: 1
757+ max-decl-lines : 2
709758 # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax.
710- max-decl-chars : 30
759+ # Default: 30
760+ max-decl-chars : 40
711761
712762 importas :
713763 # Do not allow unaliased imports of aliased packages.
@@ -809,15 +859,16 @@ linters-settings:
809859 nlreturn :
810860 # Size of the block (including return statement that is still "OK")
811861 # so no return split required.
812- block-size : 1
862+ # Default: 1
863+ block-size : 2
813864
814865 nolintlint :
815866 # Disable to ensure that all nolint directives actually have an effect.
816867 # Default: false
817- allow-unused : false
868+ allow-unused : true
818869 # Disable to ensure that nolint directives don't have a leading space.
819870 # Default: true
820- allow-leading-space : true
871+ allow-leading-space : false
821872 # Exclude following linters from requiring an explanation.
822873 # Default: []
823874 allow-no-explanation : [ ]
@@ -844,9 +895,11 @@ linters-settings:
844895
845896 predeclared :
846897 # Comma-separated list of predeclared identifiers to not report on.
847- ignore : " "
898+ # Default: ""
899+ ignore : " new,int"
848900 # Include method names and field names (i.e., qualified names) in checks.
849- q : false
901+ # Default: false
902+ q : true
850903
851904 promlinter :
852905 # Promlinter cannot infer all metrics name in static analysis.
@@ -1172,13 +1225,15 @@ linters-settings:
11721225 - github.com/jmoiron/sqlx
11731226
11741227 staticcheck :
1175- # Select the Go version to target. The default is '1.13'.
1228+ # Select the Go version to target.
1229+ # Default: 1.13
11761230 go : " 1.15"
11771231 # https://staticcheck.io/docs/options#checks
11781232 checks : [ "all" ]
11791233
11801234 stylecheck :
1181- # Select the Go version to target. The default is '1.13'.
1235+ # Select the Go version to target.
1236+ # Default: 1.13
11821237 go : " 1.15"
11831238 # https://staticcheck.io/docs/options#checks
11841239 checks : [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
@@ -1244,6 +1299,7 @@ linters-settings:
12441299
12451300 varcheck :
12461301 # Check usage of exported fields and variables.
1302+ # Default: false
12471303 exported-fields : true
12481304
12491305 varnamelen :
@@ -1288,9 +1344,11 @@ linters-settings:
12881344
12891345 whitespace :
12901346 # Enforces newlines (or comments) after every multi-line if statement.
1291- multi-if : false
1347+ # Default: false
1348+ multi-if : true
12921349 # Enforces newlines (or comments) after every multi-line function signature.
1293- multi-func : false
1350+ # Default: false
1351+ multi-func : true
12941352
12951353 wrapcheck :
12961354 # An array of strings that specify substrings of signatures to ignore.
@@ -1380,6 +1438,7 @@ linters-settings:
13801438 # Optional.
13811439 original-url : github.com/golangci/example-linter
13821440
1441+
13831442linters :
13841443 # Disable all linters.
13851444 disable-all : true
@@ -1662,6 +1721,7 @@ issues:
16621721 # Fix found issues (if it's supported by the linter).
16631722 fix : true
16641723
1724+
16651725severity :
16661726 # Set the default severity for issues.
16671727 #
0 commit comments