|
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + timeout: 240m |
| 4 | + go: "1.24" |
| 5 | + build-tags: |
| 6 | + - integration |
| 7 | + - scanner_db_integration |
| 8 | + - sql_integration |
| 9 | + - test_e2e |
| 10 | + modules-download-mode: readonly |
| 11 | +output: |
| 12 | + formats: |
| 13 | + text: |
| 14 | + path: stdout |
| 15 | + junit-xml: |
| 16 | + path: report.xml |
| 17 | +linters: |
| 18 | + # please, do not use `enable-all`: it's deprecated and will be removed soon. |
| 19 | + # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint |
| 20 | + default: none |
| 21 | + enable: |
| 22 | + - asciicheck |
| 23 | + - copyloopvar |
| 24 | + - errcheck |
| 25 | + - forbidigo |
| 26 | + - gocritic |
| 27 | + - exptostd |
| 28 | + - gosec |
| 29 | + - govet |
| 30 | + - ineffassign |
| 31 | + - nolintlint |
| 32 | + - protogetter |
| 33 | + - revive # replaces golint |
| 34 | + - rowserrcheck |
| 35 | + - staticcheck |
| 36 | + - wrapcheck |
| 37 | + # - nakedret TODO: add in follow-up |
| 38 | + # - unconvert TODO: add in follow-up |
| 39 | + # - unparam TODO: add in follow-up |
| 40 | + # - unused // enabled in Makefile as it fails with release tag |
| 41 | + - usestdlibvars |
| 42 | + settings: |
| 43 | + errcheck: |
| 44 | + disable-default-exclusions: false |
| 45 | + check-type-assertions: false |
| 46 | + check-blank: false |
| 47 | + exclude-functions: |
| 48 | + - (*bytes.Buffer).WriteString |
| 49 | + - (*strings.Builder).WriteByte |
| 50 | + - (*strings.Builder).WriteRune |
| 51 | + - (*strings.Builder).WriteString |
| 52 | + - fmt.Fprint |
| 53 | + - fmt.Fprintf |
| 54 | + - fmt.Fprintln |
| 55 | + - fmt.Print |
| 56 | + - fmt.Printf |
| 57 | + - fmt.Println |
| 58 | + - github.com/stackrox/rox/pkg/utils.Should |
| 59 | + forbidigo: |
| 60 | + forbid: |
| 61 | + - pattern: ^print\(.*\)$ |
| 62 | + - pattern: fmt\.Print.*(# Disallowed function used\. Use environments functions for printing or to a specific writer from environment\.InputOutput\(\)\.)? |
| 63 | + - pattern: os\.Stdout(# Disallowed output streams used\. Use environment\.InputOutput\(\).Out instead\.)? |
| 64 | + - pattern: os\.Stderr(# Disallowed output streams used\. Use environment\.InputOutput\(\).ErrOut instead\.)? |
| 65 | + - pattern: os\.Stdin(# Disallowed output streams used\. Use environment\.InputOutput\(\).In instead\.)? |
| 66 | + gocritic: |
| 67 | + disabled-checks: |
| 68 | + - appendAssign |
| 69 | + - argOrder |
| 70 | + - assignOp |
| 71 | + - captLocal |
| 72 | + - dupArg |
| 73 | + - elseif |
| 74 | + - exitAfterDefer |
| 75 | + - ifElseChain |
| 76 | + - mapKey |
| 77 | + - singleCaseSwitch |
| 78 | + - unlambda |
| 79 | + - wrapperFunc |
| 80 | + gosec: |
| 81 | + includes: |
| 82 | + - G101 |
| 83 | + - G102 |
| 84 | + - G103 |
| 85 | + - G104 |
| 86 | + - G106 |
| 87 | + - G108 |
| 88 | + - G109 |
| 89 | + - G111 |
| 90 | + - G201 |
| 91 | + - G202 |
| 92 | + - G203 |
| 93 | + - G303 |
| 94 | + - G307 |
| 95 | + - G403 |
| 96 | + - G502 |
| 97 | + - G503 |
| 98 | + - G504 |
| 99 | + - G601 |
| 100 | + govet: |
| 101 | + disable: |
| 102 | + - shadow |
| 103 | + - fieldalignment |
| 104 | + enable-all: true |
| 105 | + settings: |
| 106 | + printf: |
| 107 | + funcs: |
| 108 | + - Print |
| 109 | + - Printf |
| 110 | + - Println |
| 111 | + - Debug |
| 112 | + - Debugf |
| 113 | + - Info |
| 114 | + - Infof |
| 115 | + - Warn |
| 116 | + - Warnf |
| 117 | + - Error |
| 118 | + - Errorf |
| 119 | + - github.com/stackrox/rox/migrator/log.WritetoStderr |
| 120 | + - github.com/stackrox/rox/migrator/log.WritetoStderrf |
| 121 | + nolintlint: |
| 122 | + require-explanation: false |
| 123 | + require-specific: true |
| 124 | + allow-unused: false |
| 125 | + revive: |
| 126 | + rules: |
| 127 | + - name: package-comments |
| 128 | + disabled: true |
| 129 | + - name: error-strings |
| 130 | + disabled: true |
| 131 | + - name: unexported-return |
| 132 | + disabled: true |
| 133 | + staticcheck: |
| 134 | + checks: |
| 135 | + - all |
| 136 | + - -QF1001 |
| 137 | + - -QF1002 |
| 138 | + - -QF1003 |
| 139 | + - -QF1006 |
| 140 | + - -QF1007 |
| 141 | + - -QF1008 |
| 142 | + - -QF1009 |
| 143 | + - -QF1011 |
| 144 | + - -QF1012 |
| 145 | + - -SA1019 |
| 146 | + - -SA4001 |
| 147 | + - -ST1000 |
| 148 | + - -ST1001 |
| 149 | + - -ST1003 |
| 150 | + - -ST1005 |
| 151 | + - -ST1017 |
| 152 | + - -ST1019 |
| 153 | + - -ST1020 |
| 154 | + - -ST1021 |
| 155 | + - -ST1022 |
| 156 | + - -ST1023 |
| 157 | + wrapcheck: |
| 158 | + ignore-sig-regexps: |
| 159 | + - \(\*github\.com\/stackrox\/rox\/pkg\/errorhelpers\.ErrorList\)\.ToError\(\) |
| 160 | + - backoff.Retry.* |
| 161 | + - concurrency\.WithLock.* |
| 162 | + - errox\..+\.CausedBy(f)? |
| 163 | + - policy\.NewErr.* |
| 164 | + - retry\.MakeRetryable |
| 165 | + - retry\.WithRetry |
| 166 | + - status\.Error |
| 167 | + - utils\.Should |
| 168 | + exclusions: |
| 169 | + generated: lax |
| 170 | + rules: |
| 171 | + - linters: |
| 172 | + - wrapcheck |
| 173 | + path: ^(central|compliance|integration-tests|local|migrator|operator|pkg|scanner|sensor/tests/helper|tests|tools|scale)/ |
| 174 | + - linters: |
| 175 | + - forbidigo |
| 176 | + path: (central/graphql/schema/print|compliance|integration-tests|local|migrator|operator|pkg|scanner|sensor|tests|tools|scale|govulncheck|compliance/virtualmachines/agent)/ |
| 177 | + - linters: |
| 178 | + - forbidigo |
| 179 | + path: roxctl/central/generate/interactive.go |
| 180 | + - linters: |
| 181 | + - forbidigo |
| 182 | + - wrapcheck |
| 183 | + path: _test\.go |
| 184 | + - linters: |
| 185 | + - forbidigo |
| 186 | + path: roxctl/common/io/io\.go # io.go will by default use os.Stdin/os.StdErr. |
| 187 | + paths: |
| 188 | + - pkg/complianceoperator/api |
| 189 | + - third_party$ |
| 190 | + - builtin$ |
| 191 | + - examples$ |
| 192 | +issues: |
| 193 | + max-issues-per-linter: 0 |
| 194 | + max-same-issues: 0 |
| 195 | +formatters: |
| 196 | + enable: |
| 197 | + - gofmt |
| 198 | + - goimports |
| 199 | + exclusions: |
| 200 | + generated: lax |
| 201 | + paths: |
| 202 | + - pkg/complianceoperator/api |
| 203 | + - third_party$ |
| 204 | + - builtin$ |
| 205 | + - examples$ |
0 commit comments