|
| 1 | +version: "2" |
| 2 | + |
| 3 | +linters: |
| 4 | + # Configure the linter set. To avoid unexpected results the implicit default |
| 5 | + # set is ignored and all the ones to use are explicitly enabled. |
| 6 | + default: none |
| 7 | + enable: |
| 8 | + # Default |
| 9 | + - errcheck |
| 10 | + - govet |
| 11 | + - ineffassign |
| 12 | + - staticcheck |
| 13 | + - unused |
| 14 | + # Additional |
| 15 | + - gocritic |
| 16 | + - misspell |
| 17 | + #- prealloc |
| 18 | + #- revive |
| 19 | + - unconvert |
| 20 | + # Configure checks. Mostly using defaults but with some commented exceptions. |
| 21 | + settings: |
| 22 | + staticcheck: |
| 23 | + # With staticcheck there is only one setting, so to extend the implicit |
| 24 | + # default value it must be explicitly included. |
| 25 | + checks: |
| 26 | + # Default |
| 27 | + - all |
| 28 | + - -ST1000 |
| 29 | + - -ST1003 |
| 30 | + - -ST1005 |
| 31 | + - -ST1012 |
| 32 | + - -ST1016 |
| 33 | + - -ST1020 |
| 34 | + - -ST1021 |
| 35 | + - -ST1022 |
| 36 | + # Disable quickfix checks |
| 37 | + - -QF* |
| 38 | + gocritic: |
| 39 | + # With gocritic there are different settings, but since enabled-checks |
| 40 | + # and disabled-checks cannot both be set, for full customization the |
| 41 | + # alternative is to disable all defaults and explicitly enable the ones |
| 42 | + # to use. |
| 43 | + disable-all: true |
| 44 | + enabled-checks: |
| 45 | + #- appendAssign # Skip default |
| 46 | + - argOrder |
| 47 | + - assignOp |
| 48 | + - badCall |
| 49 | + - badCond |
| 50 | + #- captLocal # Skip default |
| 51 | + - caseOrder |
| 52 | + - codegenComment |
| 53 | + #- commentFormatting # Skip default |
| 54 | + - defaultCaseOrder |
| 55 | + - deprecatedComment |
| 56 | + - dupArg |
| 57 | + - dupBranchBody |
| 58 | + - dupCase |
| 59 | + - dupSubExpr |
| 60 | + - elseif |
| 61 | + #- exitAfterDefer # Skip default |
| 62 | + - flagDeref |
| 63 | + - flagName |
| 64 | + #- ifElseChain # Skip default |
| 65 | + - mapKey |
| 66 | + - newDeref |
| 67 | + - offBy1 |
| 68 | + - regexpMust |
| 69 | + - ruleguard # Enable additional check that are not enabled by default |
| 70 | + #- singleCaseSwitch # Skip default |
| 71 | + - sloppyLen |
| 72 | + - sloppyTypeAssert |
| 73 | + - switchTrue |
| 74 | + - typeSwitchVar |
| 75 | + - underef |
| 76 | + - unlambda |
| 77 | + - unslice |
| 78 | + - valSwap |
| 79 | + - wrapperFunc |
| 80 | + revive: |
| 81 | + # With revive there is in reality only one setting, and when at least one |
| 82 | + # rule are specified then only these rules will be considered, defaults |
| 83 | + # and all others are then implicitly disabled, so must explicitly enable |
| 84 | + # all rules to be used. |
| 85 | + rules: |
| 86 | + - name: blank-imports |
| 87 | + disabled: false |
| 88 | + - name: context-as-argument |
| 89 | + disabled: false |
| 90 | + - name: context-keys-type |
| 91 | + disabled: false |
| 92 | + - name: dot-imports |
| 93 | + disabled: false |
| 94 | + #- name: empty-block # Skip default |
| 95 | + # disabled: true |
| 96 | + - name: error-naming |
| 97 | + disabled: false |
| 98 | + - name: error-return |
| 99 | + disabled: false |
| 100 | + - name: error-strings |
| 101 | + disabled: false |
| 102 | + - name: errorf |
| 103 | + disabled: false |
| 104 | + - name: exported |
| 105 | + disabled: false |
| 106 | + #- name: increment-decrement # Skip default |
| 107 | + # disabled: true |
| 108 | + - name: indent-error-flow |
| 109 | + disabled: false |
| 110 | + - name: package-comments |
| 111 | + disabled: false |
| 112 | + - name: range |
| 113 | + disabled: false |
| 114 | + - name: receiver-naming |
| 115 | + disabled: false |
| 116 | + #- name: redefines-builtin-id # Skip default |
| 117 | + # disabled: true |
| 118 | + #- name: superfluous-else # Skip default |
| 119 | + # disabled: true |
| 120 | + - name: time-naming |
| 121 | + disabled: false |
| 122 | + - name: unexported-return |
| 123 | + disabled: false |
| 124 | + #- name: unreachable-code # Skip default |
| 125 | + # disabled: true |
| 126 | + #- name: unused-parameter # Skip default |
| 127 | + # disabled: true |
| 128 | + - name: var-declaration |
| 129 | + disabled: false |
| 130 | + - name: var-naming |
| 131 | + disabled: false |
| 132 | + |
| 133 | +formatters: |
| 134 | + enable: |
| 135 | + - goimports |
| 136 | + |
| 137 | +issues: |
| 138 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 139 | + max-issues-per-linter: 0 |
| 140 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 141 | + max-same-issues: 0 |
| 142 | + |
| 143 | +run: |
| 144 | + # Timeout for total work, e.g. 30s, 5m, 5m30s. Default is 0 (disabled). |
| 145 | + timeout: 10m |
0 commit comments