sigs.k8s.io/cluster-api-provider-aws@v1.5.5/.golangci.yml (about)

     1  linters:
     2    enable-all: true
     3    disable:
     4      - bidichk
     5      - contextcheck
     6      - cyclop
     7      - dupl
     8      - durationcheck
     9      - errname
    10      - errorlint
    11      - exhaustive
    12      - exhaustivestruct
    13      - exhaustruct
    14      - forcetypeassert
    15      - forbidigo
    16      - funlen
    17      - gochecknoglobals
    18      - gochecknoinits
    19      - gocognit
    20      - godox
    21      - goerr113
    22      - gofumpt
    23      - golint
    24      - gomnd
    25      - gomoddirectives
    26      - gomodguard
    27      - interfacer
    28      - ireturn
    29      - lll
    30      - makezero
    31      - maligned
    32      - nestif
    33      - nilnil
    34      - nlreturn
    35      - nonamedreturns
    36      - nosnakecase
    37      - paralleltest
    38      - promlinter
    39      - scopelint
    40      - sqlclosecheck
    41      - tagliatelle
    42      - tenv
    43      - testpackage
    44      - tparallel
    45      - varnamelen
    46      - wastedassign
    47      - wrapcheck
    48      - wsl
    49  
    50  linters-settings:
    51    # Restrict revive to exported.
    52    revive:
    53      # see https://github.com/mgechev/revive#available-rules for details.
    54      ignore-generated-header: true
    55      severity: warning
    56      rules:
    57        - name: exported
    58          severity: warning
    59    ifshort:
    60      # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax.
    61      max-decl-chars: 50
    62    gci:
    63      sections:
    64        - standard
    65        - default
    66        - prefix(sigs.k8s.io/cluster-api)
    67    importas:
    68      no-unaliased: false
    69      alias:
    70        - pkg: k8s.io/api/core/v1
    71          alias: corev1
    72        - pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
    73          alias: apiextensionsv1
    74        - pkg: k8s.io/apimachinery/pkg/apis/meta/v1
    75          alias: metav1
    76        - pkg: k8s.io/apimachinery/pkg/api/errors
    77          alias: apierrors
    78        - pkg: k8s.io/apimachinery/pkg/util/errors
    79          alias: kerrors
    80        - pkg: sigs.k8s.io/controller-runtime/pkg/conversion
    81          alias: ctrlconversion
    82        - pkg: sigs.k8s.io/cluster-api/util/conversion
    83          alias: utilconversion
    84        - pkg: k8s.io/apimachinery/pkg/conversion
    85          alias: apiconversion
    86        - pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1beta1
    87          alias: infrav1
    88        - pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3
    89          alias: expinfrav1alpha3
    90        - pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4
    91          alias: expinfrav1alpha4
    92        - pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1
    93          alias: expinfrav1
    94        - pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4
    95          alias: infrav1alpha4
    96        - pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3
    97          alias: infrav1alpha3
    98        - pkg: k8s.io/client-go/kubernetes/scheme
    99          alias: cgscheme
   100        - pkg: k8s.io/client-go/tools/record
   101          alias: cgrecord
   102        - pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha3
   103          alias: eksbootstrapv1alpha3
   104        - pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4
   105          alias: eksbootstrapv1alpha4
   106        - pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1
   107          alias: eksbootstrapv1
   108        - pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3
   109          alias: ekscontrolplanev1alpha3
   110        - pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4
   111          alias: ekscontrolplanev1alpha4
   112        - pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1
   113          alias: ekscontrolplanev1
   114        - pkg: "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/controllers"
   115          alias: eksbootstrapcontrollers
   116        - pkg: "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/controllers"
   117          alias: ekscontrolplanecontrollers
   118        - pkg: "sigs.k8s.io/cluster-api-provider-aws/exp/controllers"
   119          alias: expcontrollers
   120        - pkg: "k8s.io/apimachinery/pkg/runtime"
   121          alias: runtime
   122        - pkg: "k8s.io/apimachinery/pkg/runtime/serializer"
   123          alias: runtimeserializer
   124        - pkg: "k8s.io/apimachinery/pkg/runtime/serializer/yaml"
   125          alias: yamlserializer
   126        - pkg:  "sigs.k8s.io/cluster-api/api/v1alpha3"
   127          alias: clusterv1alpha3
   128        - pkg:  "sigs.k8s.io/cluster-api/api/v1alpha4"
   129          alias: clusterv1alpha4
   130        - pkg: "sigs.k8s.io/cluster-api/api/v1beta1"
   131          alias: clusterv1
   132        - pkg: "sigs.k8s.io/cluster-api/util/defaulting"
   133          alias: utildefaulting
   134        - pkg: sigs.k8s.io/controller-runtime
   135          alias: ctrl
   136        - pkg: "k8s.io/apimachinery/pkg/api/errors"
   137          alias: apierrors
   138        - pkg: "sigs.k8s.io/controller-runtime/pkg/log"
   139          alias: logf
   140        - pkg: "github.com/google/gofuzz"
   141          alias: fuzz
   142        - pkg: "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/logs"
   143          alias: awslogs
   144        - pkg: "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/metrics"
   145          alias: awsmetrics
   146        - pkg: "sigs.k8s.io/cluster-api/errors"
   147          alias: capierrors
   148        - pkg: "github.com/aws/aws-sdk-go/aws/client"
   149          alias: awsclient
   150        - pkg:  "github.com/aws/amazon-vpc-cni-k8s/pkg/apis/crd/v1alpha1"
   151          alias: amazoncni
   152        - pkg: "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
   153          alias: rgapi
   154        - pkg: "crypto/rand"
   155          alias: crand
   156        - pkg: "sigs.k8s.io/controller-runtime/pkg/client"
   157          alias: crclient
   158        - pkg: "k8s.io/apimachinery/pkg/types"
   159          alias: apimachinerytypes
   160        - pkg: "sigs.k8s.io/cluster-api/exp/api/v1beta1"
   161          alias: expclusterv1
   162    staticcheck:
   163      go: "1.17"
   164    stylecheck:
   165      go: "1.17"
   166  issues:
   167    max-same-issues: 0
   168    max-issues-per-linter: 0
   169    # We are disabling default golangci exclusions because we want to help reviewers to focus on reviewing the most relevant
   170    # changes in PRs and avoid nitpicking.
   171    exclude-use-default: false
   172    # List of regexps of issue texts to exclude, empty list by default.
   173    exclude:
   174      - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
   175      - "exported: exported (const|function|method|type|var) (.+) should have comment or be unexported"
   176      - "exported: (func|type) name will be used as (.+) by other packages, and that stutters; consider calling this (.+)"
   177      - (G104|G107|G404|G505|ST1000)
   178      - "G108: Profiling endpoint is automatically exposed on /debug/pprof"
   179      # Exclude noctx error for calling http.Get directly.
   180      # See https://pkg.go.dev/github.com/sonatard/noctx#readme-how-to-fix for reasons it breaks and ways to fix it.
   181      # This exclusion should be removed if the decision is made to fix the error.
   182      - "net/http.Get must not be called"
   183    exclude-rules:
   184      # Exclude revive's exported for certain packages and code, e.g. tests and fake.
   185      - linters:
   186        - revive
   187        text: exported (method|function|type|const) (.+) should have comment or be unexported
   188        source: (func|type).*Fake.*
   189      - linters:
   190        - revive
   191        text: exported (method|function|type|const) (.+) should have comment or be unexported
   192        path: fake_\.go
   193      - linters:
   194        - revive
   195        text: exported (method|function|type|const) (.+) should have comment or be unexported
   196        path: .*test/(providers|framework|e2e).*.go
   197      - linters:
   198        - errcheck
   199        text: Error return value is not checked
   200        path: _test\.go
   201      - linters:
   202        - errcheck
   203        text: Error return value of (.+) is not checked
   204        path: _test\.go
   205      - linters:
   206        - gosec
   207        text: "G108: Profiling endpoint is automatically exposed on /debug/pprof"
   208      - linters:
   209        - godot
   210        text: "Comment should end in a period"
   211        path: "(.*)/(v1alpha3|v1alpha4|v1alpha1)/(.*)types.go"
   212      - linters:
   213        - errcheck
   214        text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
   215      # With Go 1.16, the new embed directive can be used with an un-named import,
   216      # revive (previously, golint) only allows these to be imported in a main.go, which wouldn't work for us.
   217      # This directive allows the embed package to be imported with an underscore everywhere.
   218      - linters:
   219        - revive
   220        source: _ "embed"
   221      # This directive allows the variable in defaults.go files to have underscore
   222      - linters:
   223        - revive
   224        text: "var-naming: don't use underscores in Go names; func (.+) should be (.+)"
   225        path: .*/defaults.go
   226      # Disable unparam "always receives" which might not be really
   227      # useful when building libraries.
   228      - linters:
   229        - unparam
   230        text: always receives
   231      # Dot imports for gomega or ginkgo are allowed
   232      # within test files.
   233      - path: _test\.go
   234        text: should not use dot imports
   235      - path: (framework|e2e)/.*.go
   236        text: should not use dot imports
   237      - path: _test\.go
   238        text: cyclomatic complexity
   239      - linters:
   240        - unparam
   241        text: (.+) - (`t`|`g`) is unused
   242      - path: _test\.go
   243        text: cyclomatic complexity
   244      # Append should be able to assign to a different var/slice.
   245      - linters:
   246        - gocritic
   247        text: "appendAssign: append result not assigned to the same slice"
   248  
   249  run:
   250    timeout: 10m
   251    build-tags:
   252      - tools
   253      - e2e
   254    skip-files:
   255    - "zz_generated.*\\.go$"
   256    - ".*conversion.*\\.go$"
   257    skip-dirs:
   258    - third_party
   259    allow-parallel-runners: true