aboutsummaryrefslogblamecommitdiff
path: root/.golangci.yml
blob: b8b8f9d587c95a87a1041a253aff7a17e1518995 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804



































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                          
run:
  tests: true # include test files or not, default is true
  go: '1.22'

linters:
  enable:
    - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
    - bodyclose # checks whether HTTP response body is closed successfully
    - depguard # Go linter that checks if package imports are in a list of acceptable packages
    - dupl # Tool for code clone detection
    - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
    - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13
    - exhaustive # check exhaustiveness of enum switch statements and map literals
    - exportloopref # checks for pointers to enclosing loop variables
    - gochecknoinits # Checks that no init functions are present in Go code
    - gocognit # Computes and checks the cognitive complexity of functions
    - goconst # Finds repeated strings that could be replaced by a constant
    - gocritic # Provides diagnostics that check for bugs, performance and style issues
    - gocyclo # Computes and checks the cyclomatic complexity of functions
    - godot # Check if comments end in a period
    - gofmt # Gofmt checks whether code was gofmt-ed. By default, this tool runs with -s option to check for code simplification
    - goheader # Checks is file header matches to pattern
    - goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt
    - gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
    - gosec # Inspects source code for security problems
    - gosimple # Linter for Go source code that specializes in simplifying code
    - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
    - ineffassign # Detects when assignments to existing variables are not used
    - misspell # Finds commonly misspelled English words in comments
    - nakedret # Finds naked returns in functions greater than a specified function length
    - nestif # Reports deeply nested if statements
    - noctx # noctx finds sending http request without context.Context
    - nolintlint # Reports ill-formed or insufficient nolint directives
    - paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test
    - prealloc # Finds slice declarations that could potentially be pre-allocated
    - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint
    - rowserrcheck # checks whether Err of rows is checked successfully
    - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed
    - staticcheck # It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint
    - stylecheck # Stylecheck is a replacement for golint
    - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
    - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
    - unconvert # Remove unnecessary type conversions
    - unparam # Reports unused function parameters
    - unused # Checks Go code for unused constants, variables, functions and types
    - whitespace # Tool for detection of leading and trailing whitespace
    - asasalint # check for pass []any as any in variadic func(...any)
    - bidichk # Checks for dangerous unicode character sequences
    - containedctx # containedctx is a linter that detects struct contained context.Context field
    - cyclop # checks function and package cyclomatic complexity
    - decorder # check declaration order and count of types, constants, variables and functions
    - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
    - dupword # checks for duplicate words in the source code
    - durationcheck # check for two durations multiplied together
    - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted.
    - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`
    - execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds
    - forbidigo # Forbids identifiers
    - forcetypeassert # finds forced type assertions
    - funlen # Tool for detection of long functions
    - gomnd # An analyzer to detect magic numbers
    - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod
    - goprintffuncname # Checks that printf-like functions are named with `f` at the end
    - grouper # An analyzer to analyze expression groups
    - importas # Enforces consistent import aliases
    - interfacebloat # A linter that checks the number of methods inside an interface
    - lll # Reports long lines
    - loggercheck # Checks key valur pairs for common logger libraries (kitlog,klog,logr,zap)
    - maintidx # maintidx measures the maintainability index of each function
    - makezero # Finds slice declarations with non-zero initial length
    - nilerr # Finds the code that returns nil even if it checks that the error is not nil
    - nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value
    - nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
    - nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL
    - predeclared # find code that shadows one of Go's predeclared identifiers
    - promlinter # Check Prometheus metrics naming via promlint
    - reassign # Checks that package variables are not reassigned
    - tagliatelle # Checks the struct tags
    - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
    - testableexamples # linter checks if examples are testable (have an expected output)
    - thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
    - usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library
    - varnamelen # checks that the length of a variable's name matches its scope
    - wastedassign # wastedassign finds wasted assignment statements
    - wsl # Whitespace Linter - Forces you to use empty lines
  disable:
    # [disabled]
    # Use goimports instead.
    - gci # Gci controls golang package import order and makes it always deterministic
    # This is just a most stupid linter rule ever.
    - testpackage # linter that makes you use a separate _test package
    # Sometimes you really need globals.
    - gochecknoglobals # check that no global variables exist
    # This is stupid.
    - exhaustruct # Checks if all structure fields are initialized.
    # Sometimes you just have to return unwrapped error.
    - wrapcheck # Checks that errors returned from external packages are wrapped.
    # Not always and not everywhere.
    - ireturn # Accept Interfaces, Return Concrete Types.
    # They are useful to handle errors in deferred functions.
    - nonamedreturns # Reports all named returns.
    # Disabled because of lack of configuration. It makes a lot of unnecessary noise.
    - goerr113 # Golang linter to check the errors handling expressions.
    # Disabled because of the bug of reporting already sorted imports order.
    - gofumpt # Gofumpt checks whether code was gofumpt-ed.

    # [deprecated]
    - structcheck # Finds unused struct fields
    - varcheck # Finds unused global variables and constants
    - deadcode # Finds unused code
    - exhaustivestruct # Checks if all struct's fields are initialized
    - godox # Tool for detection of FIXME, TODO and other comment keywords
    - golint # Golint differs from gofmt. Gofmt reformat Go source code, whereas golint prints out style mistakes
    - ifshort # Checks that your code uses short syntax for if-statements whenever possible
    - interfacer # Linter that suggests narrower interface types
    - maligned # Tool to detect Go structs that would take less memory if their fields were sorted
    - nosnakecase # nosnakecase is a linter that detects snake case of variable naming and function name
    - scopelint # Scopelint checks for unpinned variables in go programs

linters-settings:
  depguard:
    rules:
      prevent_unmaintained_packages:
        list-mode: lax # allow unless explicitely denied
        files:
          - $all
          - "!$test"
        allow:
          - $gostd
        deny:
          - pkg: io/ioutil
            desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"

  paralleltest:
    # Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
    # Default: false
    ignore-missing: true

  revive:
    # Maximum number of open files at the same time.
    # See https://github.com/mgechev/revive#command-line-flags
    # Defaults to unlimited.

    # When set to false, ignores files with "GENERATED" header, similar to golint.
    # See https://github.com/mgechev/revive#available-rules for details.
    # Default: false
    ignore-generated-header: true
    # Sets the default severity.
    # See https://github.com/mgechev/revive#configuration
    # Default: warning
    severity: warning
    # Enable all available rules.
    # Default: false
    enable-all-rules: true
    # Sets the default failure confidence.
    # This means that linting errors with less than 0.8 confidence will be ignored.
    # Default: 0.8
    confidence: 0.1
    rules:
      # Suggests using constant for magic numbers and string literals.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#add-constant
      # TODO: try rule later. Looks like it is broken in 1.50.0. Use gomnd instead
      - name: add-constant
        severity: warning
        disabled: true
        arguments:
          - maxLitCount: '5'
            allowStrs: '""'
            allowInts: '0,1,2,3,4,5,6,7,8,9,10,24,30,31'
            allowFloats: '0.0,0.,1.0,1.,2.0,2.'


      # Warns when a function receives more parameters than the maximum set by the rule's configuration.
      # Enforcing a maximum number of parameters helps to keep the code readable and maintainable.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#argument-limit
      - name: argument-limit
        severity: warning
        disabled: false
        arguments: [ 4 ]

      # Check for commonly mistaken usages of the sync/atomic package
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic
      - name: atomic
        severity: warning
        disabled: false

      # Warns on bare (a.k.a. naked) returns
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#banned-characters
      - name: banned-characters
        severity: warning
        disabled: false
        arguments: [ "Ω", "Σ", "σ", "7" ]

      # Checks given banned characters in identifiers(func, var, const). Comments are not checked.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return
      - name: bare-return
        severity: warning
        disabled: false

      # Blank import should be only in a main or test package, or have a comment justifying it.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports
      - name: blank-imports
        severity: warning
        disabled: false

      # Using Boolean literals (true, false) in logic expressions may make the code less readable.
      # This rule suggests removing Boolean literals from logic expressions.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
      - name: bool-literal-in-expr
        severity: warning
        disabled: false

      # Explicitly invoking the garbage collector is, except for specific uses in benchmarking, very dubious.
      # The garbage collector can be configured through environment variables as described here: https://pkg.go.dev/runtime
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#call-to-gc
      - name: call-to-gc
        severity: warning
        disabled: false

      # Description: Cognitive complexity is a measure of how hard code is to understand.
      # While cyclomatic complexity is good to measure "testability" of the code, cognitive complexity
      # aims to provide a more precise measure of the difficulty of understanding the code.
      # Enforcing a maximum complexity per function helps to keep code readable and maintainable.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cognitive-complexity
      - name: cognitive-complexity
        severity: warning
        disabled: false
        arguments: [ 30 ]

      # Methods or fields of struct that have names different only by capitalization could be confusing.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-naming
      - name: confusing-naming
        severity: warning
        disabled: false

      # Function or methods that return multiple, no named, values of the same type could induce error.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#confusing-results
      - name: confusing-results
        severity: warning
        disabled: false

      # The rule spots logical expressions that evaluate always to the same value.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr
      - name: constant-logical-expr
        severity: warning
        disabled: false

      # By convention, context.Context should be the first parameter of a function.
      # https://github.com/golang/go/wiki/CodeReviewComments#contexts
      # This rule spots function declarations that do not follow the convention.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument
      - name: context-as-argument
        severity: warning
        disabled: false
        arguments: [ { allowTypesBefore = "*testing.T" } ]

      # Basic types should not be used as a key in context.WithValue.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type
      - name: context-keys-type
        severity: warning
        disabled: false

      # Cyclomatic complexity is a measure of code complexity.
      # Enforcing a maximum complexity per function helps to keep code readable and maintainable.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cyclomatic
      - name: cyclomatic
        severity: warning
        disabled: false
        arguments: [ 15 ]

      # This rule spots potential dataraces caused by go-routines capturing (by-reference) particular
      # identifiers of the function from which go-routines are created.
      # The rule is able to spot two of such cases: go-routines capturing named return values,
      # and capturing for-range values.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace
      - name: datarace
        severity: warning
        disabled: false

      # Packages exposing functions that can stop program execution by exiting are hard to reuse.
      # This rule looks for program exits in functions other than main() or init().
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit
      - name: deep-exit
        severity: warning
        disabled: false

      # This rule warns on some common mistakes when using defer statement.
      # It currently alerts on the following situations:
      # - [ call-chain ] - even if deferring call-chains of the form foo()() is valid,
      # it does not help code understanding (only the last call is deferred)
      # - [ loop ] - deferring inside loops can be misleading (deferred functions are not executed at the end
      # of the loop iteration but of the current function) and it could lead to exhausting the execution stack
      # - [ method-call ] - deferring a call to a method can lead to subtle bugs if the method does not have a pointer receiver
      # - [ recover ] - calling recover outside a deferred function has no effect
      # - [ immediate-recover ] - calling recover at the time a defer is registered, rather than as part of the deferred callback.
      # e.g. defer recover() or equivalent.
      # - [ return ] - returning values form a deferred function has no effect.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer
      - name: defer
        severity: warning
        disabled: false
        arguments:
          - [ "call-chain", "loop", "method-call", "recover", "immediate-recover", "return" ]

      # Importing with . makes the programs much harder to understand because it is unclear
      # whether names belong to the current package or to an imported package.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports
      - name: dot-imports
        severity: warning
        disabled: false

      # It is possible to unintentionally import the same package twice.
      # This rule looks for packages that are imported two or more times.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports
      - name: duplicated-imports
        severity: warning
        disabled: false

      # In GO it is idiomatic to minimize nesting statements, a typical example is to avoid if-then-else constructions.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return
      - name: early-return
        severity: warning
        disabled: false

      # Empty blocks make code less readable and could be a symptom of a bug or unfinished refactoring.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block
      - name: empty-block
        severity: warning
        disabled: false

      # Sometimes gofmt is not enough to enforce a common formatting of a code-base.
      # This rule warns when there are heading or trailing newlines in code blocks.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
      - name: empty-lines
        severity: warning
        disabled: false

      # By convention, for the sake of readability, variables of type error must be named with the prefix err.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming
      - name: error-naming
        severity: warning
        disabled: false

      # By convention, for the sake of readability, the errors should be last in the list of returned values by a function.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return
      - name: error-return
        severity: warning
        disabled: false

      # By convention, for better readability, error messages should not be capitalized or end with punctuation or a newline.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings
      - name: error-strings
        severity: warning
        disabled: false

      # It is possible to get a simpler program by replacing errors.New(fmt.Sprintf()) with fmt.Errorf().
      # This rule spots that kind of simplification opportunities.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf
      - name: errorf
        severity: warning
        disabled: false

      # Exported function and methods should have comments.
      # This warns on undocumented exported functions and methods.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
      - name: exported
        severity: warning
        disabled: false
        arguments: [ ]

      # This rule helps to enforce a common header for all source files in a project by spotting those files
      # that do not have the specified header.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#file-header
      - name: file-header
        severity: warning
        disabled: true
        arguments: [ "" ]

      # If a function controls the flow of another by passing it information on what to do, both functions are said to be control-coupled.
      # Coupling among functions must be minimized for better maintainability of the code.
      # This rule warns on boolean parameters that create a control coupling.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter
      - name: flag-parameter
        severity: warning
        disabled: false

      # Functions returning too many results can be hard to understand/use.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit
      - name: function-result-limit
        severity: warning
        disabled: false
        arguments: [ 2 ]

      # Functions too long (with many statements and/or lines) can be hard to understand.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length
      - name: function-length
        severity: warning
        disabled: false
        # (int,int) the maximum allowed statements and lines.
        # Must be non-negative integers. Set to 0 to disable the check
        arguments: [ 30, 0 ]

      # Typically, functions with names prefixed with Get are supposed to return a value.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return
      - name: get-return
        severity: warning
        disabled: false

      # An if-then-else conditional with identical implementations in both branches is an error.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches
      - name: identical-branches
        severity: warning
        disabled: false

      # Checking if an error is nil to just after return the error or nil is redundant.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return
      - name: if-return
        severity: warning
        disabled: false

      # By convention, for better readability, incrementing an integer variable by 1 is recommended
      # to be done using the ++ operator.
      # This rule spots expressions like i += 1 and i -= 1 and proposes to change them into i++ and i--.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement
      - name: increment-decrement
        severity: warning
        disabled: false

      # To improve the readability of code, it is recommended to reduce the indentation as much as possible.
      # This rule highlights redundant else-blocks that can be eliminated from the code.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow
      - name: indent-error-flow
        severity: warning
        disabled: false

      # Warns when importing black-listed packages.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#imports-blacklist
      - name: imports-blocklist
        severity: warning
        disabled: false
        arguments:
          - "crypto/md5"
          - "crypto/sha1"

      # In GO it is possible to declare identifiers (packages, structs, interfaces, parameters,
      # receivers, variables, constants...) that conflict with the name of an imported package.
      # This rule spots identifiers that shadow an import.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing
      - name: import-shadowing
        severity: warning
        disabled: false

      # Warns in the presence of code lines longer than a configured maximum.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#line-length-limit
      - name: line-length-limit
        severity: warning
        disabled: false
        arguments: [ 150 ]

      # Packages declaring too many public structs can be hard to understand/use,
      # and could be a symptom of bad design.
      # This rule warns on files declaring more than a configured, maximum number of public structs.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs
      - name: max-public-structs
        severity: warning
        disabled: true
        arguments: [ 3 ]

      # A function that modifies its parameters can be hard to understand.
      # It can also be misleading if the arguments are passed by value by the caller.
      # This rule warns when a function modifies one or more of its parameters.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-parameter
      - name: modifies-parameter
        severity: warning
        disabled: false

      # A method that modifies its receiver value can have undesired behavior.
      # The modification can be also the root of a bug because the actual value receiver could be a copy of that used at the calling site.
      # This rule warns when a method modifies its receiver.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-value-receiver
      - name: modifies-value-receiver
        severity: warning
        disabled: false

      # Packages declaring structs that contain other inline struct definitions can be hard to understand/read for other developers.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#nested-structs
      - name: nested-structs
        severity: warning
        disabled: false

      # conditional expressions can be written to take advantage of short circuit evaluation and speed up
      # its average evaluation time by forcing the evaluation of less time-consuming terms before more costly ones.
      # This rule spots logical expressions where the order of evaluation of terms seems non-optimal.
      # Please notice that confidence of this rule is low and is up to the user to decide if the suggested
      # rewrite of the expression keeps the semantics of the original one.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#optimize-operands-order
      - name: optimize-operands-order
        severity: warning
        disabled: false

      # Packages should have comments. This rule warns on undocumented packages and when packages comments are detached to the package keyword.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments
      - name: package-comments
        severity: warning
        disabled: false

      # This rule suggests a shorter way of writing ranges that do not use the second value.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range
      - name: range
        severity: warning
        disabled: false

      # Range variables in a loop are reused at each iteration; therefore a goroutine created
      # in a loop will point to the range variable with from the upper scope.
      # This way, the goroutine could use the variable with an undesired value.
      # This rule warns when a range value (or index) is used inside a closure.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure
      - name: range-val-in-closure
        severity: warning
        disabled: false

      # Range variables in a loop are reused at each iteration. This rule warns when assigning the address of the variable,
      # passing the address to append() or using it in a map.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address
      - name: range-val-address
        severity: warning
        disabled: false

      # By convention, receiver names in a method should reflect their identity.
      # For example, if the receiver is of type Parts, p is an adequate name for it.
      # Contrary to other languages, it is not idiomatic to name receivers as this or self.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#receiver-naming
      - name: receiver-naming
        severity: warning
        disabled: false

      # Constant names like false, true, nil, function names like append, make, and basic type names like bool,
      # and byte are not reserved words of the language; therefore the can be redefined.
      # Even if possible, redefining these built in names can lead to bugs very difficult to detect.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id
      - name: redefines-builtin-id
        severity: warning
        disabled: false

      # explicit type conversion string(i) where i has an integer type other than
      # rune might behave not as expected by the developer (e.g. string(42) is not "42").
      # This rule spot that kind of suspicious conversions.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-of-int
      - name: string-of-int
        severity: warning
        disabled: false

      # This rule allows you to configure a list of regular expressions that string literals
      # in certain function calls are checked against. This is geared towards user facing applications
      # where string literals are often used for messages that will be presented to users,
      # so it may be desirable to enforce consistent formatting.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format
      - name: string-format
        severity: warning
        disabled: true
        arguments: [ ]

      # Struct tags are not checked at compile time.
      # This rule, checks and warns if it finds errors in common struct tags types like:
      # asn1, default, json, protobuf, xml, yaml.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
      - name: struct-tag
        severity: warning
        disabled: false

      # To improve the readability of code, it is recommended to reduce the indentation as much as possible.
      # This rule highlights redundant else-blocks that can be eliminated from the code.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else
      - name: superfluous-else
        severity: warning
        disabled: false

      # This rule warns when using == and != for equality check time.Time and suggest to time.time.Equal method,
      # for about information follow this link: https://pkg.go.dev/time#Time
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal
      - name: time-equal
        severity: warning
        disabled: false

      # Using unit-specific suffix like "Secs", "Mins", ... when naming variables of type time.Duration
      # can be misleading, this rule highlights those cases.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-naming
      - name: time-naming
        severity: warning
        disabled: false

      # This rule warns when initialism, variable or package naming conventions are not followed.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
      - name: var-naming
        severity: warning
        disabled: false
        arguments:
          - [ ] # AllowList
          - [ "ID", "VM" ] # DenyList

      # This rule proposes simplifications of variable declarations.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration
      - name: var-declaration
        severity: warning
        disabled: false

      # Unconditional recursive calls will produce infinite recursion, thus program stack overflow.
      # This rule detects and warns about unconditional (direct) recursive calls.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion
      - name: unconditional-recursion
        severity: warning
        disabled: false

      # This rule warns on wrongly named un-exported symbols, i.e. un-exported symbols whose name
      # start with a capital letter.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming
      - name: unexported-naming
        severity: warning
        disabled: false

      # This rule warns when an exported function or method returns a value of an un-exported type.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return
      - name: unexported-return
        severity: warning
        disabled: false

      # This rule warns when errors returned by a function are not explicitly handled on the caller side.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
      - name: unhandled-error
        severity: warning
        disabled: false
        arguments:
          - "fmt.Println"
          - "fmt.Printf"

      # This rule suggests to remove redundant statements like a break at the end of a case block,
      # for improving the code's readability.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt
      - name: unnecessary-stmt
        severity: warning
        disabled: false

      # This rule spots and proposes to remove unreachable code.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unreachable-code
      - name: unreachable-code
        severity: warning
        disabled: false

      # This rule warns on unused parameters. Functions or methods with unused parameters can be a symptom of an unfinished refactoring or a bug.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
      - name: unused-parameter
        severity: warning
        disabled: false

      # This rule warns on unused method receivers.
      # Methods with unused receivers can be a symptom of an unfinished refactoring or a bug.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver
      - name: unused-receiver
        severity: warning
        disabled: false

      # This rule warns on useless break statements in case clauses of switch and select statements.
      # GO, unlike other programming languages like C, only executes statements of the selected case
      # while ignoring the subsequent case clauses.
      # Therefore, inserting a break at the end of a case clause has no effect.
      # Because break statements are rarely used in case clauses, when switch or select statements
      # are inside a for-loop, the programmer might wrongly assume that a break in a case clause will
      # take the control out of the loop. The rule emits a specific warning for such cases.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
      - name: useless-break
        severity: warning
        disabled: false

      # Function parameters that are passed by value, are in fact a copy of the original argument.
      # Passing a copy of a sync.WaitGroup is usually not what the developer wants to do.
      # This rule warns when a sync.WaitGroup expected as a by-value parameter in a function or method.
      # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value
      - name: waitgroup-by-value
        severity: warning
        disabled: false

  forbidigo:
    # Forbid the following identifiers (list of regexp).
    # Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
    forbid:
      # Optionally put comments at the end of the regex, surrounded by `(# )?`
      # Escape any special characters.
      - '^print.*$(# print statements should not be committed)'
    # Exclude godoc examples from forbidigo checks.
    # Default: true
    exclude-godoc-examples: true

  cyclop:
    # The maximal code complexity to report.
    # Default: 10
    max-complexity: 15
    # The maximal average package complexity.
    # If it's higher than 0.0 (float) the check is enabled
    # Default: 0.0
    package-average: 6
    # Should ignore tests.
    # Default: false
    skip-tests: true

  funlen:
    # Checks the number of lines in a function.
    # If lower than 0, disable the check.
    # Default: 60
    lines: 200
    # Checks the number of statements in a function.
    # If lower than 0, disable the check.
    # Default: 40
    statements: 50

  tagliatelle:
    # Check the struck tag name case.
    case:
      # Use the struct field name to check the name of the struct tag.
      # Default: false
      use-field-name: false
      # `camel` is used for `json` and `yaml` (can be overridden)
      # Default: {}
      rules:
        # Any struct tag type can be used.
        # Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
        json: snake
        yaml: camel
        xml: camel
        bson: camel
        avro: snake
        mapstructure: kebab

  varnamelen:
    # The longest distance, in source lines, that is being considered a "small scope".
    # Variables used in at most this many lines will be ignored.
    # Default: 5
    max-distance: 10
    # The minimum length of a variable's name that is considered "long".
    # Variable names that are at least this long will be ignored.
    # Default: 3
    min-name-length: 1
    # Check method receivers.
    # Default: false
    check-receiver: true
    # Check named return values.
    # Default: false
    check-return: true
    # Check type parameters.
    # Default: false
    check-type-param: true
    # Ignore "ok" variables that hold the bool return value of a type assertion.
    # Default: false
    ignore-type-assert-ok: true
    # Ignore "ok" variables that hold the bool return value of a map index.
    # Default: false
    ignore-map-index-ok: true
    # Ignore "ok" variables that hold the bool return value of a channel receive.
    # Default: false
    ignore-chan-recv-ok: true
    # Optional list of variable names that should be ignored completely.
    # Default: []
    ignore-names:
      - err
    # Optional list of variable declarations that should be ignored completely.
    # Entries must be in one of the following forms (see below for examples):
    # - for variables, parameters, named return values, method receivers, or type parameters:
    #   <name> <type>  (<type> can also be a pointer/slice/map/chan/...)
    # - for constants: const <name>
    #
    # Default: []
    ignore-decls:
      - t testing.T
      - e error
      - i int
      - T any

  lll:
    # Max line length, lines longer will be reported.
    # '\t' is counted as 1 character by default, and can be changed with the tab-width option.
    # Default: 120.
    line-length: 150
    # Tab width in spaces.
    # Default: 1
    tab-width: 1

  nlreturn:
    # Size of the block (including return statement that is still "OK")
    # so no return split required.
    # Default: 1
    block-size: 3

  wsl:
    # See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for
    # documentation of available settings. These are the defaults for golangci-lint.
    allow-assign-and-anything: false
    allow-assign-and-call: true
    allow-cuddle-declarations: false
    allow-multiline-assign: true
    allow-separated-leading-comment: false
    allow-trailing-comment: false
    force-case-trailing-whitespace: 0
    force-err-cuddling: false
    force-short-decl-cuddling: false
    strict-append: true