|
| 1 | +# This file contains all available configuration options |
| 2 | +# with their default values. |
| 3 | + |
| 4 | +# options for analysis running |
| 5 | +run: |
| 6 | + # default concurrency is a available CPU number |
| 7 | + concurrency: 4 |
| 8 | + |
| 9 | + # timeout for analysis, e.g. 30s, 5m, default is 1m |
| 10 | + timeout: 5m |
| 11 | +linters-settings: |
| 12 | + goimports: |
| 13 | + # put imports beginning with prefix after 3rd-party packages; |
| 14 | + # it's a comma-separated list of prefixes |
| 15 | + local-prefixes: github.com/freiheit-com/nmww |
| 16 | + depguard: |
| 17 | + rules: |
| 18 | + main: |
| 19 | + list-mode: lax # Everything is allowed unless it is denied |
| 20 | + deny: |
| 21 | + - pkg: "github.com/stretchr/testify" |
| 22 | + desc: Do not use a testing framework |
| 23 | + misspell: |
| 24 | + # Correct spellings using locale preferences for US or UK. |
| 25 | + # Default is to use a neutral variety of English. |
| 26 | + # Setting locale to US will correct the British spelling of 'colour' to 'color'. |
| 27 | + locale: US |
| 28 | + golint: |
| 29 | + min-confidence: 0.8 |
| 30 | + gosec: |
| 31 | + excludes: |
| 32 | + # Suppressions: (see https://github.com/securego/gosec#available-rules for details) |
| 33 | + - G104 # "Audit errors not checked" -> which we don't need and is a badly implemented version of errcheck |
| 34 | + - G102 # "Bind to all interfaces" -> since this is normal in k8s |
| 35 | + - G304 # "File path provided as taint input" -> too many false positives |
| 36 | + - G307 # "Deferring unsafe method "Close" on type "io.ReadCloser" -> false positive when calling defer resp.Body.Close() |
| 37 | + nakedret: |
| 38 | + max-func-lines: 0 |
| 39 | + revive: |
| 40 | + ignore-generated-header: true |
| 41 | + severity: error |
| 42 | + # https://github.com/mgechev/revive |
| 43 | + rules: |
| 44 | + - name: errorf |
| 45 | + - name: context-as-argument |
| 46 | + - name: error-return |
| 47 | + - name: increment-decrement |
| 48 | + - name: indent-error-flow |
| 49 | + - name: superfluous-else |
| 50 | + - name: unused-parameter |
| 51 | + - name: unreachable-code |
| 52 | + - name: atomic |
| 53 | + - name: empty-lines |
| 54 | + - name: early-return |
| 55 | + gocritic: |
| 56 | + enabled-tags: |
| 57 | + - performance |
| 58 | + - style |
| 59 | + - experimental |
| 60 | + disabled-checks: |
| 61 | + - wrapperFunc |
| 62 | + - typeDefFirst |
| 63 | + - ifElseChain |
| 64 | + - dupImport # https://github.com/go-critic/go-critic/issues/845 |
1 | 65 | linters: |
2 | 66 | enable: |
3 | | - - deadcode |
4 | | - - errcheck |
5 | | - - goconst |
6 | | - - gofmt |
7 | | - - golint |
8 | | - - gosec |
| 67 | + # https://golangci-lint.run/usage/linters/ |
| 68 | + # default linters |
| 69 | + - gosimple |
9 | 70 | - govet |
10 | 71 | - ineffassign |
11 | | - - interfacer |
12 | | - - lll |
13 | | - - megacheck |
| 72 | + - staticcheck |
| 73 | + - typecheck |
| 74 | + - unused |
| 75 | + # additional linters |
| 76 | + - errorlint |
| 77 | + - gochecknoinits |
| 78 | + - gocritic |
| 79 | + - gofmt |
| 80 | + - goimports |
| 81 | + - gosec |
14 | 82 | - misspell |
15 | 83 | - nakedret |
16 | | - - structcheck |
17 | | - - unconvert |
18 | | - - varcheck |
19 | | - enable-all: false |
20 | | -run: |
21 | | - skip-files: |
22 | | - - schema.go |
23 | | - - pulumiManifest.go |
24 | | - timeout: 20m |
| 84 | + - revive |
| 85 | + - depguard |
| 86 | + - bodyclose |
| 87 | + - sqlclosecheck |
| 88 | + - wastedassign |
| 89 | + - forcetypeassert |
| 90 | + - errcheck |
| 91 | + disable: |
| 92 | + - noctx # false positive: finds errors with http.NewRequest that dont make sense |
| 93 | + - unparam # false positives |
| 94 | +issues: |
| 95 | + exclude-use-default: false |
0 commit comments