go.uber.org/cadence@v1.2.9/revive.toml (about) 1 # config for https://github.com/mgechev/revive 2 # 3 # largely the same reasoning as https://github.com/uber/cadence , but not intended to be identical. 4 # libraries have different needs / goals than applications, so some drift is desirable. 5 ignoreGeneratedHeader = false 6 severity = "error" 7 confidence = 0.8 8 errorCode = 1 9 warningCode = 0 10 11 [directive.specify-disable-reason] 12 severity = "error" 13 14 #### roughly what golint does. probably only disable noisy ones. 15 16 [rule.blank-imports] 17 [rule.context-as-argument] 18 [rule.context-keys-type] 19 [rule.dot-imports] 20 [rule.error-naming] 21 [rule.error-return] 22 [rule.error-strings] 23 [rule.errorf] 24 # [rule.exported] # disabled due to lack of value / encouraging bad habits. it complains about internal packages. 25 [rule.if-return] 26 [rule.increment-decrement] 27 [rule.indent-error-flow] 28 # [rule.package-comments] # disabled due to lack of value / encouraging bad habits. it complains about internal packages. 29 [rule.range] 30 [rule.receiver-naming] 31 [rule.time-naming] 32 [rule.unexported-return] 33 [rule.var-declaration] 34 [rule.var-naming] # noisy, but would be good to fix these in v2 35 36 #### higher value stuff 37 38 # this is basically errcheck, warns on errs that are not checked. 39 # strongly desired, but disabled due to 300 failures (to be tackled incrementally). 40 # [rule.unhandled-error] 41 42 # general defer gotchas. 43 # 44 # in particular: "recover" warns about unsafe use of recover(). 45 # this has caught bugs that can allow crashes while seemingly safe, and are *extremely* hard to catch in review. 46 # 47 # the arguments are excluding only "call-chain", which would disallow `defer someFn(...)()` which is both useful and in use. 48 [rule.defer] 49 arguments=[["loop","method-call","recover","return", "immediate-recover"]] 50 51 # string(int) is almost always a bug. 52 # go vet considers this a fatal error, but only in 1.15 or newer, and go.mod currently targets 1.13 53 [rule.string-of-int] 54 55 #### added because we currently have zero violations, and they seem decent enough to retain 56 57 [rule.atomic] # correct use of sync code, important 58 [rule.call-to-gc] # beneficial 59 [rule.constant-logical-expr] # minor code simplifier 60 [rule.identical-branches] # code simplifier / failures are pretty dubious 61 [rule.modifies-parameter] # beneficial 62 [rule.modifies-value-receiver] # probably beneficial, prevents subtle bugs 63 [rule.range-val-address] # beneficial 64 [rule.range-val-in-closure] # beneficial 65 [rule.unconditional-recursion] # probably a good idea 66 [rule.unreachable-code] # code simplifier 67 [rule.waitgroup-by-value] # correct use of sync code, important 68 69 #### unused utilities 70 71 # [rule.file-header] # could possibly replace `copyright -verifyOnly`? 72 # [rule.imports-blacklist] # simple way to ban imports / enforce wrappers, likely useful 73 74 #### disabled but maybe desirable 75 76 # [rule.bare-return] # probably beneficial as it's slightly error-prone, but 2,000 failures 77 # [rule.bool-literal-in-expr] # minor code simplifier, few failures 78 # [rule.confusing-results] # maybe beneficial, only a few failures 79 # [rule.deep-exit] # probably a good idea in most code, some failures, but not trivial to adopt 80 # [rule.duplicated-imports] # minor, but may be worthwhile. failures are weird but harmless 81 # [rule.early-return] # minor code simplifier, a handful of failures 82 # [rule.get-return] # existing failures are intentional + desirable, but in principle it's a fine idea 83 # [rule.import-shadowing] # probably beneficial, but 750 failures 84 # [rule.redefines-builtin-id] # probably beneficial, few failures 85 # [rule.struct-tag] # probably beneficial, a few failures 86 # [rule.superfluous-else] # minor code simplifier, a few failures 87 # [rule.unexported-naming] # probably beneficial, but 300 failures 88 # [rule.unused-parameter] # minor code simplifier / clarifier, but 250 failures 89 # [rule.unused-receiver] # minor code simplifier / clarifier, but 500 failures 90 91 #### probably undesirable 92 93 # [rule.add-constant] # extremely noisy. 18,000 failures, overwhelmingly for tests or 0/1 which seem totally fine 94 # [rule.argument-limit] # too arbitrary 95 # [rule.cognitive-complexity] # dubious value, but possibly interesting 96 # [rule.confusing-naming] # dubious value, ~50 failures 97 # [rule.cyclomatic] # dubious value, but possibly interesting 98 # [rule.empty-block] # easily noticed in code review, but also warns on documented no-op branches, which seem fine 99 # [rule.empty-lines] # low value, many failures 100 # [rule.flag-parameter] # interesting, but very noisy 101 # [rule.function-result-limit] # too arbitrary, easily noticed in code review 102 # [rule.line-length-limit] # too arbitrary 103 # [rule.max-public-structs] # too arbitrary 104 # [rule.unnecessary-stmt] # dubious value