|
| 1 | +run: |
| 2 | + # default concurrency is a available CPU number |
| 3 | + #concurrency: 4 |
| 4 | + |
| 5 | + # timeout for analysis, e.g. 30s, 5m, default is 1m |
| 6 | + timeout: 5m |
| 7 | + |
| 8 | + # exit code when at least one issue was found, default is 1 |
| 9 | + # issues-exit-code: 1 |
| 10 | + |
| 11 | + # include test files or not, default is true |
| 12 | + tests: true |
| 13 | + |
| 14 | + # list of build tags, all linters use it. Default is empty list. |
| 15 | + #build-tags: |
| 16 | + # - mytag |
| 17 | + |
| 18 | + # which dirs to skip: issues from them won't be reported; |
| 19 | + # can use regexp here: generated.*, regexp is applied on full path; |
| 20 | + # default value is empty list, but default dirs are skipped independently |
| 21 | + # from this option's value (see skip-dirs-use-default). |
| 22 | + # "/" will be replaced by current OS file path separator to properly work |
| 23 | + # on Windows. |
| 24 | + #skip-dirs: |
| 25 | + # - src/external_libs |
| 26 | + # - autogenerated_by_my_lib |
| 27 | + |
| 28 | + # default is true. Enables skipping of directories: |
| 29 | + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ |
| 30 | + skip-dirs-use-default: true |
| 31 | + |
| 32 | + # which files to skip: they will be analyzed, but issues from them |
| 33 | + # won't be reported. Default value is empty list, but there is |
| 34 | + # no need to include all autogenerated files, we confidently recognize |
| 35 | + # autogenerated files. If it's not please let us know. |
| 36 | + # "/" will be replaced by current OS file path separator to properly work |
| 37 | + # on Windows. |
| 38 | + # skip-files: |
| 39 | + # - export_test.go |
| 40 | + |
| 41 | + # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": |
| 42 | + # If invoked with -mod=readonly, the go command is disallowed from the implicit |
| 43 | + # automatic updating of go.mod described above. Instead, it fails when any changes |
| 44 | + # to go.mod are needed. This setting is most useful to check that go.mod does |
| 45 | + # not need updates, such as in a continuous integration and testing system. |
| 46 | + # If invoked with -mod=vendor, the go command assumes that the vendor |
| 47 | + # directory holds the correct copies of dependencies and ignores |
| 48 | + # the dependency descriptions in go.mod. |
| 49 | + # modules-download-mode: readonly|release|vendor |
| 50 | + |
| 51 | + # Allow multiple parallel golangci-lint instances running. |
| 52 | + # If false (default) - golangci-lint acquires file lock on start. |
| 53 | + allow-parallel-runners: false |
| 54 | + |
| 55 | +# output configuration options |
| 56 | +output: |
| 57 | +# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" |
| 58 | +# format: colored-line-number |
| 59 | + |
| 60 | +# print lines of code with issue, default is true |
| 61 | +# print-issued-lines: true |
| 62 | + |
| 63 | +# print linter name in the end of issue text, default is true |
| 64 | +# print-linter-name: true |
| 65 | + |
| 66 | +# make issues output unique by line, default is true |
| 67 | +# uniq-by-line: true |
| 68 | + |
| 69 | +# add a prefix to the output file references; default is no prefix |
| 70 | + path-prefix: "" |
| 71 | + |
| 72 | +# all available settings of specific linters |
| 73 | +# @see all available linters and options here: https://golangci-lint.run/usage/linters/ |
| 74 | +linters-settings: |
| 75 | + gci: |
| 76 | + # Section configuration to compare against. |
| 77 | + # Section names are case-insensitive and may contain parameters in (). |
| 78 | + # The default order of sections is `standard > default > custom > blank > dot`, |
| 79 | + # If `custom-order` is `true`, it follows the order of `sections` option. |
| 80 | + # Default: ["standard", "default"] |
| 81 | + sections: |
| 82 | + - standard # Standard section: captures all standard packages. |
| 83 | + - default # Default section: contains all imports that could not be matched to another section type. |
| 84 | + - prefix(github.com/xconnio) # Custom section: groups all imports with the specified Prefix. |
| 85 | + # Skip generated files. |
| 86 | + # Default: true |
| 87 | + #skip-generated: false |
| 88 | + # Enable custom order of sections. |
| 89 | + # If `true`, make the section order the same as the order of `sections`. |
| 90 | + # Default: false |
| 91 | + custom-order: true |
| 92 | + |
| 93 | +linters: |
| 94 | + # enable the following linters |
| 95 | + enable: |
| 96 | + - errcheck |
| 97 | + - gosimple |
| 98 | + - govet |
| 99 | + - ineffassign |
| 100 | + - misspell |
| 101 | + - typecheck |
| 102 | + - asciicheck |
| 103 | + - bidichk |
| 104 | + - contextcheck |
| 105 | + - decorder |
| 106 | + - durationcheck |
| 107 | + - errorlint |
| 108 | + - execinquery |
| 109 | + - exportloopref |
| 110 | + - gci |
| 111 | + - gochecknoglobals |
| 112 | + - goconst |
| 113 | + - godot |
| 114 | + - gofmt |
| 115 | + #- gomnd |
| 116 | + - gosec |
| 117 | + - nakedret |
| 118 | + - nilerr |
| 119 | + - testpackage |
| 120 | + - unused |
| 121 | + - unconvert |
| 122 | + - unparam |
| 123 | + - lll |
| 124 | + # disable everything else |
| 125 | + disable-all: true |
| 126 | + |
| 127 | +issues: |
| 128 | + # List of regexps of issue texts to exclude, empty list by default. |
| 129 | + # But independently from this option we use default exclude patterns, |
| 130 | + # it can be disabled by `exclude-use-default: false`. To list all |
| 131 | + # excluded by default patterns execute `golangci-lint run --help` |
| 132 | + # exclude: |
| 133 | + # - abcdef |
| 134 | + |
| 135 | + # Excluding configuration per-path, per-linter, per-text and per-source |
| 136 | + exclude-rules: |
| 137 | + # Exclude some linters from running on tests files. |
| 138 | + - path: _test\.go |
| 139 | + linters: |
| 140 | + - gocyclo |
| 141 | + - errcheck |
| 142 | + - dupl |
| 143 | + - gosec |
| 144 | + |
| 145 | + - path: export.*_test\.go |
| 146 | + linters: |
| 147 | + - testpackage |
| 148 | + - gochecknoglobals |
| 149 | + |
| 150 | + # benchmarks are little noisy |
| 151 | + - path: benchmarks/* |
| 152 | + linters: |
| 153 | + - unparam |
| 154 | + - unused |
| 155 | + |
| 156 | + # disable noise from errcheck |
| 157 | + - linters: |
| 158 | + - errcheck |
| 159 | + text: ".AbortWithReason" |
| 160 | + |
| 161 | + # Independently from option `exclude` we use default exclude patterns, |
| 162 | + # it can be disabled by this option. To list all |
| 163 | + # excluded by default patterns execute `golangci-lint run --help`. |
| 164 | + # Default value for this option is true. |
| 165 | + exclude-use-default: true |
| 166 | + |
| 167 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 168 | + max-per-linter: 0 |
| 169 | + |
| 170 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 171 | + max-same-issues: 0 |
| 172 | + |
| 173 | + # Show only new issues: if there are unstaged changes or untracked files, |
| 174 | + # only those changes are analyzed, else only changes in HEAD~ are analyzed. |
| 175 | + # It's a super-useful option for integration of golangci-lint into existing |
| 176 | + # large codebase. It's not practical to fix all existing issues at the moment |
| 177 | + # of integration: much better don't allow issues in new code. |
| 178 | + # Default is false. |
| 179 | + new: false |
0 commit comments