|
| 1 | +issues: |
| 2 | + max-issues-per-linter: 0 |
| 3 | + max-same-issues: 0 |
| 4 | + |
| 5 | +linters: |
| 6 | + settings: |
| 7 | + depguard: |
| 8 | + rules: |
| 9 | + main: |
| 10 | + list-mode: lax |
| 11 | + deny: |
| 12 | + # Cannot use gomodguard, which examines go.mod, as "golang.org/x/exp/slices" is not a module and doesn't appear in go.mod. |
| 13 | + - pkg: "golang.org/x/exp/slices" |
| 14 | + desc: "Use 'slices' instead" |
| 15 | + - pkg: "golang.org/x/exp/maps" |
| 16 | + desc: "Use 'maps' or 'github.com/samber/lo' instead" |
| 17 | + dupl: |
| 18 | + threshold: 100 |
| 19 | + errcheck: |
| 20 | + check-type-assertions: true |
| 21 | + check-blank: true |
| 22 | + goconst: |
| 23 | + min-len: 3 |
| 24 | + min-occurrences: 3 |
| 25 | + gocritic: |
| 26 | + disabled-checks: |
| 27 | + - appendAssign |
| 28 | + - commentedOutCode |
| 29 | + - hugeParam |
| 30 | + - importShadow # FIXME |
| 31 | + - indexAlloc |
| 32 | + - rangeValCopy |
| 33 | + - regexpSimplify |
| 34 | + - sloppyReassign |
| 35 | + - unnamedResult |
| 36 | + - whyNoLint |
| 37 | + enabled-tags: |
| 38 | + - diagnostic |
| 39 | + - style |
| 40 | + - performance |
| 41 | + - experimental |
| 42 | + - opinionated |
| 43 | + gocyclo: |
| 44 | + min-complexity: 20 |
| 45 | + gomodguard: |
| 46 | + blocked: |
| 47 | + modules: |
| 48 | + - github.com/hashicorp/go-version: |
| 49 | + recommendations: |
| 50 | + - github.com/aquasecurity/go-version |
| 51 | + reason: "`aquasecurity/go-version` is designed for our use-cases" |
| 52 | + - github.com/Masterminds/semver: |
| 53 | + recommendations: |
| 54 | + - github.com/aquasecurity/go-version |
| 55 | + reason: "`aquasecurity/go-version` is designed for our use-cases" |
| 56 | + gosec: |
| 57 | + excludes: |
| 58 | + - G101 |
| 59 | + - G114 |
| 60 | + - G115 |
| 61 | + - G204 |
| 62 | + - G304 |
| 63 | + - G402 |
| 64 | + govet: |
| 65 | + disable: |
| 66 | + - shadow |
| 67 | + misspell: |
| 68 | + locale: US |
| 69 | + ignore-rules: |
| 70 | + - behaviour |
| 71 | + - licence |
| 72 | + - optimise |
| 73 | + - simmilar |
| 74 | + perfsprint: |
| 75 | + # Optimizes even if it requires an int or uint type cast. |
| 76 | + int-conversion: true |
| 77 | + # Optimizes into `err.Error()` even if it is only equivalent for non-nil errors. |
| 78 | + err-error: true |
| 79 | + # Optimizes `fmt.Errorf`. |
| 80 | + errorf: true |
| 81 | + # Optimizes `fmt.Sprintf` with only one argument. |
| 82 | + sprintf1: false |
| 83 | + # Optimizes into strings concatenation. |
| 84 | + strconcat: false |
| 85 | + revive: |
| 86 | + max-open-files: 2048 |
| 87 | + # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md |
| 88 | + rules: |
| 89 | + - name: bool-literal-in-expr |
| 90 | + - name: context-as-argument |
| 91 | + arguments: |
| 92 | + - allowTypesBefore: "*testing.T" |
| 93 | + - name: duplicated-imports |
| 94 | + - name: early-return |
| 95 | + arguments: |
| 96 | + - preserve-scope |
| 97 | + - name: if-return |
| 98 | + - name: increment-decrement |
| 99 | + - name: indent-error-flow |
| 100 | + arguments: |
| 101 | + - preserve-scope |
| 102 | + - name: range |
| 103 | + - name: range-val-address |
| 104 | + - name: superfluous-else |
| 105 | + arguments: |
| 106 | + - preserve-scope |
| 107 | + - name: time-equal |
| 108 | + - name: unnecessary-stmt |
| 109 | + - name: unused-parameter |
| 110 | + - name: use-any |
| 111 | + |
| 112 | + staticcheck: |
| 113 | + checks: |
| 114 | + - all |
| 115 | + - -QF1008 # Omit embedded fields from selector expression |
| 116 | + - -S1007 # Simplify regular expression by using raw string literal |
| 117 | + - -S1011 # Use a single append to concatenate two slices |
| 118 | + - -S1023 # Omit redundant control flow |
| 119 | + - -SA1019 # Using a deprecated function, variable, constant or field |
| 120 | + - -SA1024 # A string cutset contains duplicate characters |
| 121 | + - -SA4004 # The loop exits unconditionally after one iteration |
| 122 | + - -SA4023 # Impossible comparison of interface value with untyped nil |
| 123 | + - -SA4032 # Comparing runtime.GOOS or runtime.GOARCH against impossible value |
| 124 | + - -SA5011 # Possible nil pointer dereference |
| 125 | + - -ST1003 # Poorly chosen identifier |
| 126 | + - -ST1012 # Poorly chosen name for error variable |
| 127 | + |
| 128 | + testifylint: |
| 129 | + enable-all: true |
| 130 | + |
| 131 | + default: none |
| 132 | + |
| 133 | + enable: |
| 134 | + - bodyclose |
| 135 | + - depguard |
| 136 | + - goconst |
| 137 | + - gocritic |
| 138 | + - gocyclo |
| 139 | + - gomodguard |
| 140 | + - gosec |
| 141 | + - govet |
| 142 | + - ineffassign |
| 143 | + - misspell |
| 144 | + - perfsprint |
| 145 | + - revive |
| 146 | + - staticcheck |
| 147 | + - testifylint |
| 148 | + - unconvert |
| 149 | + - unused |
| 150 | + - usestdlibvars |
| 151 | + - usetesting |
| 152 | + |
| 153 | + exclusions: |
| 154 | + generated: lax |
| 155 | + paths: |
| 156 | + - "pkg/iac/scanners/terraform/parser/funcs" # copies of Terraform functions |
| 157 | + rules: |
| 158 | + - path: ".*_test.go$" |
| 159 | + linters: |
| 160 | + - goconst |
| 161 | + - gosec |
| 162 | + - unused |
| 163 | + - path: ".*_test.go$" |
| 164 | + linters: |
| 165 | + - govet |
| 166 | + text: "copylocks:" |
| 167 | + - path: ".*_test.go$" |
| 168 | + linters: |
| 169 | + - gocritic |
| 170 | + text: "commentFormatting:" |
| 171 | + - path: ".*_test.go$" |
| 172 | + linters: |
| 173 | + - gocritic |
| 174 | + text: "exitAfterDefer:" |
| 175 | + - path: ".*_test.go$" |
| 176 | + linters: |
| 177 | + - gocritic |
| 178 | + text: "importShadow:" |
| 179 | + - linters: |
| 180 | + - goconst |
| 181 | + text: "string `each` has 3 occurrences, make it a constant" # FIXME |
| 182 | + presets: |
| 183 | + - comments |
| 184 | + - common-false-positives |
| 185 | + - legacy |
| 186 | + - std-error-handling |
| 187 | + warn-unused: true |
| 188 | + |
| 189 | +run: |
| 190 | + go: '1.24' |
| 191 | + timeout: 30m |
| 192 | + |
| 193 | +formatters: |
| 194 | + enable: |
| 195 | + - gci |
| 196 | + - gofmt |
| 197 | + |
| 198 | + exclusions: |
| 199 | + generated: lax |
| 200 | + |
| 201 | + settings: |
| 202 | + gci: |
| 203 | + sections: |
| 204 | + - standard |
| 205 | + - default |
| 206 | + - prefix(github.com/aquasecurity/) |
| 207 | + - blank |
| 208 | + - dot |
| 209 | + gofmt: |
| 210 | + simplify: false |
| 211 | + |
| 212 | +version: "2" |
0 commit comments