github.com/google/osv-scalibr@v0.4.1/.golangci.yaml (about) 1 # TODO(#274): this should match the configuration of osv-scanner for the most part 2 # currently it does not because using that config raises type errors, 3 # in addition to some of the rules having violations that need addressing, 4 # so the current focus is on getting as many linters as possible running 5 version: "2" 6 7 linters: 8 default: all 9 disable: 10 - cyclop # 11 - depguard # 12 - dupl # Some interfaces end up having several lines of similar code as others 13 - err113 # 14 - exhaustruct # 15 - exhaustive # TODO(#1225): work on enabling this 16 - forcetypeassert # 17 - funcorder # 18 - funlen # 19 - gochecknoglobals # 20 - gocognit # 21 - goconst # 22 - gocyclo # 23 - godot # 24 - godox # 25 - gosec # TODO(#274): work on enabling this 26 - ireturn # 27 - lll # 28 - maintidx # 29 - mnd # Not every number is magic 30 - nestif # 31 - nilnesserr # TODO(#274): work on enabling this 32 - nilnil # We consider this a valid pattern to use sometimes 33 - nlreturn # Not feasible until it's supported by the internal linter 34 - noinlineerr # 35 - nonamedreturns # 36 - paralleltest # Parallel tests mixes up log lines of multiple tests in the internal test runner 37 - prealloc # We don't want to preallocate all the time 38 - protogetter # TODO(#274): work on enabling this 39 - recvcheck # TODO(#274): work on enabling this 40 - tagliatelle # 41 - testpackage # 42 - tparallel # Parallel tests mixes up log lines of multiple tests in the internal test runner 43 - varnamelen # 44 - wrapcheck # 45 - wsl # 46 - wsl_v5 # 47 settings: 48 forbidigo: 49 forbid: 50 # Parallel tests mixes up log lines of multiple tests in the internal test runner 51 - pattern: ^testing.T.Parallel$ 52 pkg: ^testing$ 53 analyze-types: true 54 gocritic: 55 disabled-checks: 56 - ifElseChain 57 revive: 58 rules: 59 - name: blank-imports 60 disabled: false 61 - name: context-as-argument 62 disabled: false 63 - name: context-keys-type 64 disabled: false 65 - name: dot-imports 66 disabled: false 67 - name: empty-block 68 disabled: false 69 - name: error-naming 70 disabled: false 71 - name: error-return 72 disabled: false 73 - name: error-strings 74 disabled: false 75 - name: errorf 76 disabled: false 77 - name: exported 78 disabled: false 79 - name: import-alias-naming 80 disabled: false 81 - name: indent-error-flow 82 disabled: false 83 - name: package-comments 84 disabled: false 85 - name: range 86 disabled: false 87 - name: receiver-naming 88 disabled: false 89 - name: redefines-builtin-id 90 disabled: false 91 - name: superfluous-else 92 disabled: false 93 - name: time-naming 94 disabled: false 95 - name: unreachable-code 96 disabled: false 97 - name: use-any 98 disabled: false 99 - name: var-declaration 100 disabled: false 101 - name: var-naming 102 disabled: false 103 arguments: 104 - [] # AllowList 105 - [] # DenyList 106 - - skip-package-name-checks: true 107 staticcheck: 108 checks: 109 - all 110 - -SA5011 # seems prone to false positives in tests 111 - -QF1001 # apply De Morgan's law 112 - -QF1003 # use tagged switch on prefix 113 exclusions: 114 generated: lax 115 presets: 116 - common-false-positives 117 - legacy 118 - std-error-handling 119 rules: 120 - path: veles/ 121 linters: 122 - forbidigo # Parallel tests are fine and in some places needed for Veles. 123 - path: velestest/ 124 linters: 125 - forbidigo # Parallel tests are fine and in some places needed for Veles. 126 paths: 127 - third_party$ 128 - builtin$ 129 - examples$ 130 131 formatters: 132 enable: 133 - gofmt 134 - goimports 135 settings: 136 gofmt: 137 simplify: false 138 exclusions: 139 generated: lax 140 paths: 141 - third_party$ 142 - builtin$ 143 - examples$ 144 145 issues: 146 max-issues-per-linter: 0 147 max-same-issues: 0