github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/.golangci.yml (about)

     1  # options for analysis running
     2  # https://golangci-lint.run/usage/linters/
     3  
     4  linters:
     5    disable-all: true
     6    enable:
     7      - megacheck
     8      - govet
     9      - revive
    10      - gosec
    11      - stylecheck
    12      - misspell
    13      - errcheck
    14      - bidichk 
    15  
    16  # First stage linters
    17      - asciicheck      # Checks that all code identifiers does not have non-ASCII symbols in the name
    18      - durationcheck   # Check for two durations multiplied together
    19      - gochecknoinits  # Checks that no init functions are present in Go code.
    20      - gomnd
    21  
    22  # Second stage linters
    23      - unconvert    # Remove unnecessary type conversions.
    24      - predeclared  # Find code that shadows one of Go's predeclared identifiers.
    25      - mirror       # Reports wrong mirror patterns of bytes/strings usage.
    26  #    - nilerr       # Finds the code that returns nil even if it checks that the error is not nil.
    27      - testifylint  # Checks usage of github.com/stretchr/testify.
    28  
    29  
    30  # Third stage linters
    31  #------------------------------------
    32      - prealloc
    33      - perfsprint
    34      - nilnil
    35      - gocritic
    36      - exportloopref
    37      - errorlint
    38      - goconst
    39  #------------------------------------
    40  
    41  # For the future:
    42  #------------------------------------
    43  #    - testpackage
    44  #    - nonamedreturns
    45  #    - noctx 
    46  #?    - nestif
    47  #    - musttag
    48  #    - makezero
    49  #    - inamedparam
    50  #    - goerr113      
    51  #    - godox       #- searches FixMe,TODO in code
    52  #    - forbidigo
    53  #    - exhaustruct
    54  #    - unparam
    55  #------------------------------------
    56    fast: true
    57  linters-settings:
    58    gosec:
    59      excludes:
    60        - G101
    61        - G601
    62        - G602
    63    staticcheck:
    64      checks: [ "all", "-SA1019"]    
    65    stylecheck:
    66      checks: [ "all", "-ST1003", "-ST1023" ]    
    67    unparam:
    68      check-exported: true
    69    misspell:
    70      ignore-words:
    71        - untill
    72    revive:
    73    # see https://github.com/mgechev/revive#available-rules for details.
    74      ignore-generated-header: true
    75      severity: warning
    76      rules:
    77        - name: indent-error-flow
    78          severity: warning	
    79        - name: add-constant
    80          severity: warning
    81          arguments:
    82            - maxLitCount: "3"
    83              allowStrs: '""'
    84              allowInts: "0,1,2"
    85              allowFloats: "0.0,0.,1.0,1.,2.0,2."
    86    gomnd:
    87      ignored-files:
    88        - "pkg/vit/consts.go"
    89      ignored-numbers:
    90        - "0"
    91        - "1"
    92        - "2"
    93        - "3"
    94        - "4"
    95        - "5"
    96        - "10"
    97        - "32"
    98        - "42"
    99        - "100"
   100    testifylint:
   101      disable-all: true
   102      enable:
   103        - bool-compare
   104        - compares
   105        - empty
   106        - error-is-as
   107        - error-nil
   108        - expected-actual
   109        - len
   110        - require-error
   111        - suite-dont-use-pkg
   112        - suite-extra-assert-call
   113        - suite-thelper
   114    gocritic:
   115      disabled-checks:
   116        - appendAssign
   117        - dupArg
   118        - ifElseChain
   119        - singleCaseSwitch
   120        - exitAfterDefer
   121        - commentFormatting
   122    nilnil:
   123      checked-types:
   124        - func
   125    goconst:
   126      ignore-tests: true
   127  issues:
   128    exclude:
   129     - underscore
   130     - underscores
   131    exclude-rules:
   132     - path: _test.go
   133       linters:
   134         - revive
   135         - gosec
   136         - errcheck
   137         - forcetypeassert