...

Text file src/edge-infra.dev/hack/tools/linters/golangcilint.yaml

Documentation: edge-infra.dev/hack/tools/linters

     1linters-settings:
     2  goimports:
     3    local-prefixes: edge-infra.dev
     4  gosec:
     5    config:
     6      G306: "0644"
     7  depguard:
     8    rules:
     9      main:
    10        files:
    11        - $all
    12        deny:
    13        - pkg: io/ioutil
    14          desc: io/ioutil pkg is deprecated, please refactor
    15        - pkg: syscall
    16          desc: sycall deprecated, please use golang.org/x/sys/unix
    17        - pkg: github.com/fluxcd/pkg/runtime/conditions
    18          desc: use drop-in replacement edge-infra.dev/pkg/k8s/runtime/conditions instead
    19        - pkg: github.com/bradleyfalzon/ghinstallation$
    20          desc: use github.com/bradleyfalzon/ghinstallation/v2 due to vulnerabilities in v1
    21        - pkg: github.com/peterbourgon/ff$
    22          desc: use github.com/peterbourgon/ff/v3
    23        - pkg: github.com/ghodss/yaml
    24          desc: use sigs.k8s.io/yaml instead
    25        - pkg: golang.org/x/exp/slices
    26          desc: use slices instead
    27        - pkg: golang.org/x/exp/maps
    28          desc: use maps instead
    29
    30linters:
    31  disable-all: true
    32  enable:
    33  - dupl
    34  - errcheck
    35  - goconst
    36  - gocyclo
    37  - goimports
    38  - revive
    39  - gosec
    40  - gosimple
    41  - govet
    42  - ineffassign
    43  - misspell
    44  - nestif
    45  - unparam
    46  - staticcheck
    47  - unused
    48  - unconvert
    49  - whitespace
    50  - depguard
    51
    52issues:
    53  exclude-files:
    54  - pkg/edge/api/graph/mapper/mapper_secrets_test.go
    55  exclude-dirs:
    56  # Deprecated code that should be removed before fixed.
    57  - pkg/edge/gitops/chariot
    58  - pkg/edge/gitops/fns/addcluster
    59  # Forked code
    60  - pkg/f8n/devinfra/repo/owners/policybot
    61  - pkg/lib/ini
    62  - third_party
    63  exclude-rules:
    64  - path: resolvers\.go
    65    linters:
    66    - goimports
    67    - revive
    68  - path: orchestration.go
    69    linters:
    70    - gocyclo
    71  - path: session_test.go
    72    linters:
    73    - gosec
    74
    75run:
    76  # timeout for analysis, e.g. 30s, 5m, default is 1m
    77  timeout: 5m

View as plain text