code.vegaprotocol.io/vega@v0.79.0/.golangci.toml (about) 1 [run] 2 allow-parallel-runners = true 3 print-linter-name = true 4 timeout = '15m0s' 5 skip-dirs = [ 6 'protos', 7 ] 8 9 [issues] 10 max-issues-per-linter = 0 11 max-same-issues = 0 12 #new = true 13 14 [linters] 15 enable-all = true 16 disable = [ 17 "containedctx", 18 "contextcheck", 19 "cyclop", 20 "dogsled", 21 "dupl", 22 "errcheck", 23 "errchkjson", 24 "errname", 25 "errorlint", 26 "exhaustive", 27 "exhaustivestruct", 28 "forcetypeassert", 29 "funlen", 30 "gochecknoglobals", 31 "gochecknoinits", 32 "gocognit", 33 "goconst", 34 "gocritic", 35 "gocyclo", 36 "godox", 37 "goerr113", 38 "goimports", 39 "gomnd", 40 "gomoddirectives", 41 "gosec", 42 "ifshort", 43 "interfacebloat", 44 "ireturn", 45 "maintidx", 46 "nestif", 47 "nilnil", 48 "nolintlint", 49 "paralleltest", 50 "predeclared", 51 "promlinter", 52 "stylecheck", 53 "tagliatelle", 54 "testpackage", 55 "tparallel", 56 "varnamelen", 57 "wrapcheck", 58 "wsl", 59 ## New linters, disabled until we evaluate if we want them 60 "wastedassign", 61 "nakedret", 62 "rowserrcheck", 63 "musttag", 64 "govet", 65 "gosmopolitan", 66 "dupword", 67 "depguard", 68 "revive", 69 70 ## new with 1.55.2, need to evaluate 71 "testifylint", 72 "inamedparam", 73 "perfsprint", 74 "typecheck", 75 "protogetter", 76 77 ## Disabled on-pupose. 78 "exhaustruct", # We often make incomplete structs. 79 "lll", # We don't have a line length. 80 "nlreturn", # Doesn't match our code style. 81 "nonamedreturns", # We don't mind named returns. 82 83 ## Deprecated linters. 84 "deadcode", # Replaced by 'unused'. 85 "golint", # Replaced by 'revive'. 86 "interfacer", # Not replaced. 87 "maligned", # Replaced by 'go vet fieldalignment'. 88 "nosnakecase", # Replaced by 'revive'. 89 "scopelint", # Replace by 'looppointer' or 'exportloopref' 90 "structcheck", # Replaced by 'unused'. 91 "varcheck", # Replaced by 'unused'. 92 ] 93 94 [linters-settings.govet] 95 enable = [ 96 # "fieldalignment", to enable one day 97 ] 98 99 [linters-settings.goheader] 100 template = """ 101 Copyright (C) 2023 Gobalsky Labs Limited 102 103 This program is free software: you can redistribute it and/or modify 104 it under the terms of the GNU Affero General Public License as 105 published by the Free Software Foundation, either version 3 of the 106 License, or (at your option) any later version. 107 108 This program is distributed in the hope that it will be useful, 109 but WITHOUT ANY WARRANTY; without even the implied warranty of 110 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 111 GNU Affero General Public License for more details. 112 113 You should have received a copy of the GNU Affero General Public License 114 along with this program. If not, see <http://www.gnu.org/licenses/>.""" 115 116 [linters-settings.gci] 117 custom-order = true 118 sections = [ 119 "standard", # Standard section: captures all standard packages. 120 "prefix(code.vegaprotocol.io/vega)", # Custom section: groups all imports with the specified Prefix. 121 "default", # Default section: contains all imports that could not be matched to another section type. 122 "blank", # Blank section: contains all blank imports. This section is not present unless explicitly enabled. 123 "dot", 124 ] 125 126 [[issues.exclude-rules]] 127 linters = ["staticcheck"] 128 text = "SA1019:" 129 130 [[issues.exclude-rules]] 131 linters = ["staticcheck"] 132 text = "SA5008:" 133 134 [[issues.exclude-rules]] 135 path = "core/integration/setup_test.go" 136 linters = ["forbidigo"] 137 138 [[issues.exclude-rules]] 139 path = "core/matching/orderbook_test.go" 140 linters = ["forbidigo"] 141 142 [[issues.exclude-rules]] 143 path = "cmd/" 144 linters = ["forbidigo"] 145 146 [[issues.exclude-rules]] 147 path = "vegatools/" 148 linters = ["forbidigo"] 149 150 [[issues.exclude-rules]] 151 path = "flags.go" 152 linters = ["forbidigo"] 153 154 [[issues.exclude-rules]] 155 path = "print.go" 156 linters = ["forbidigo"] 157 158 [[issues.exclude-rules]] 159 path = "libs/json/json.go" 160 linters = ["forbidigo"] 161 162 [[issues.exclude-rules]] 163 path = "_test.go" 164 linters = ["exhaustruct", "noctx"] 165 166 # Don't complain about context not being first argument in tests (convention is to use *testing.T) 167 [[issues.exclude-rules]] 168 paths = ["_test.go", "helpers.go"] 169 linters = ["revive"] 170 text = "context-as-argument" 171 172 # Don't complain about underscores in test methods. 173 [[issues.exclude-rules]] 174 paths = ["_test.go", "helpers.go"] 175 linters = ["revive"] 176 text = "var-naming" 177 178 [linters-settings.forbidigo] 179 forbid = ["fmt\\.Print.*"] 180 181 # protoc doesn't want us copying protobuf messages because they can have some internal state 182 # that shouldn't be copied; but we do it a lot. see below for details 183 # https://stackoverflow.com/questions/64183794/why-do-the-go-generated-protobuf-files-contain-mutex-locks 184 [[issues.exclude-rules]] 185 linters = ["govet"] 186 text = "impl.MessageState contains sync.Mutex" 187 188 # Temporary while the test is skipped to be removed. 189 [[issues.exclude-rules]] 190 path = "market_cp_restore_test.go" 191 linters = ["unused"]