github.com/argoproj/argo-cd/v3@v3.2.1/.golangci.yaml (about)

     1  formatters:
     2    enable:
     3      - gofumpt
     4      - goimports
     5  
     6    settings:
     7      goimports:
     8        local-prefixes:
     9          - github.com/argoproj/argo-cd/v3
    10  
    11  issues:
    12    max-issues-per-linter: 0
    13  
    14    max-same-issues: 0
    15  
    16  linters:
    17    enable:
    18      - errorlint
    19      - exptostd
    20      - gocritic
    21      - gomodguard
    22      - govet
    23      - importas
    24      - misspell
    25      - perfsprint
    26      - revive
    27      - staticcheck
    28      - testifylint
    29      - thelper
    30      - tparallel
    31      - unparam
    32      - usestdlibvars
    33      - usetesting
    34      - whitespace
    35  
    36    exclusions:
    37      rules:
    38        - linters:
    39            - unparam
    40          path: (.+)_test\.go
    41  
    42      presets:
    43        - comments
    44        - common-false-positives
    45        - legacy
    46        - std-error-handling
    47  
    48      warn-unused: true
    49  
    50    settings:
    51      gocritic:
    52        enable-all: true
    53        # Most of these should probably be enabled one-by-one.
    54        disabled-checks:
    55          - appendAssign
    56          - appendCombine # Leave disabled, multi-line assigns can be more readable.
    57          - assignOp # Leave disabled, assign operations can be more confusing than helpful.
    58          - commentedOutCode
    59          - deferInLoop
    60          - exitAfterDefer
    61          - hugeParam
    62          - importShadow
    63          - paramTypeCombine # Leave disabled, there are too many failures to be worth fixing.
    64          - rangeValCopy
    65          - tooManyResultsChecker
    66          - unnamedResult
    67          - whyNoLint
    68  
    69      gomodguard:
    70        blocked:
    71          modules:
    72            - github.com/golang-jwt/jwt/v4:
    73                recommendations:
    74                  - github.com/golang-jwt/jwt/v5
    75  
    76            - github.com/imdario/mergo:
    77                recommendations:
    78                  - dario.cat/mergo
    79                reason: '`github.com/imdario/mergo` has been renamed.'
    80  
    81            - github.com/pkg/errors:
    82                recommendations:
    83                  - errors
    84  
    85      govet:
    86        disable:
    87          - fieldalignment
    88          - shadow
    89        enable-all: true
    90  
    91      importas:
    92        alias:
    93          - pkg: github.com/golang-jwt/jwt/v5
    94            alias: jwtgo
    95  
    96          - pkg: k8s.io/api/apps/v1
    97            alias: appsv1
    98  
    99          - pkg: k8s.io/api/core/v1
   100            alias: corev1
   101  
   102          - pkg: k8s.io/api/rbac/v1
   103            alias: rbacv1
   104  
   105          - pkg: k8s.io/apimachinery/pkg/api/errors
   106            alias: apierrors
   107  
   108          - pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
   109            alias: apiextensionsv1
   110  
   111          - pkg: k8s.io/apimachinery/pkg/apis/meta/v1
   112            alias: metav1
   113  
   114          - pkg: k8s.io/client-go/informers/core/v1
   115            alias: informersv1
   116  
   117          - pkg: errors
   118            alias: stderrors
   119  
   120          - pkg: github.com/argoproj/argo-cd/v3/util/io
   121            alias: utilio
   122  
   123      nolintlint:
   124        require-specific: true
   125  
   126      perfsprint:
   127        # Optimizes even if it requires an int or uint type cast.
   128        int-conversion: true
   129        # Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
   130        err-error: true
   131        # Optimizes `fmt.Errorf`.
   132        errorf: true
   133        # Optimizes `fmt.Sprintf` with only one argument.
   134        sprintf1: true
   135        # Optimizes into strings concatenation.
   136        strconcat: true
   137  
   138      revive:
   139        # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
   140        rules:
   141          - name: bool-literal-in-expr
   142  
   143          - name: blank-imports
   144            disabled: true
   145  
   146          - name: context-as-argument
   147            arguments:
   148              - allowTypesBefore: '*testing.T,testing.TB'
   149  
   150          - name: context-keys-type
   151            disabled: true
   152  
   153          - name: dot-imports
   154            disabled: true
   155  
   156          - name: duplicated-imports
   157  
   158          - name: early-return
   159            arguments:
   160              - preserveScope
   161  
   162          - name: empty-block
   163            disabled: true
   164  
   165          - name: error-naming
   166            disabled: true
   167  
   168          - name: error-return
   169  
   170          - name: error-strings
   171            disabled: true
   172  
   173          - name: errorf
   174  
   175          - name: identical-branches
   176  
   177          - name: if-return
   178  
   179          - name: increment-decrement
   180  
   181          - name: indent-error-flow
   182            arguments:
   183              - preserveScope
   184  
   185          - name: modifies-parameter
   186  
   187          - name: optimize-operands-order
   188  
   189          - name: range
   190  
   191          - name: receiver-naming
   192  
   193          - name: redefines-builtin-id
   194            disabled: true
   195  
   196          - name: redundant-import-alias
   197  
   198          - name: superfluous-else
   199            arguments:
   200              - preserveScope
   201  
   202          - name: time-equal
   203  
   204          - name: time-naming
   205            disabled: true
   206  
   207          - name: unexported-return
   208            disabled: true
   209  
   210          - name: unnecessary-stmt
   211  
   212          - name: unreachable-code
   213  
   214          - name: unused-parameter
   215  
   216          - name: use-any
   217  
   218          - name: useless-break
   219  
   220          - name: var-declaration
   221  
   222          - name: var-naming
   223            arguments:
   224              - - ID
   225              - - VM
   226              - - skipPackageNameChecks: true
   227                  upperCaseConst: true
   228  
   229      staticcheck:
   230        checks:
   231          - all
   232          - -SA5011
   233          - -ST1003
   234          - -ST1016
   235  
   236      testifylint:
   237        enable-all: true
   238  
   239        disable:
   240          - go-require
   241  
   242      unused:
   243        field-writes-are-uses: false
   244        exported-fields-are-used: false
   245  
   246      usetesting:
   247        os-mkdir-temp: false
   248  
   249  output:
   250    show-stats: false
   251  
   252  version: "2"