|
1 |
| -# MIT License |
2 |
| -# |
3 |
| -# Copyright (c) 2021 Iván Szkiba |
4 |
| -# |
5 |
| -# Permission is hereby granted, free of charge, to any person obtaining a copy |
6 |
| -# of this software and associated documentation files (the "Software"), to deal |
7 |
| -# in the Software without restriction, including without limitation the rights |
8 |
| -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
9 |
| -# copies of the Software, and to permit persons to whom the Software is |
10 |
| -# furnished to do so, subject to the following conditions: |
11 |
| -# |
12 |
| -# The above copyright notice and this permission notice shall be included in all |
13 |
| -# copies or substantial portions of the Software. |
14 |
| -# |
15 |
| -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
16 |
| -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17 |
| -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
18 |
| -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
19 |
| -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
20 |
| -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
21 |
| -# SOFTWARE. |
| 1 | +# v1.55.2 |
| 2 | +# Please don't remove the first line. It uses in CI to determine the golangci version |
| 3 | +run: |
| 4 | + deadline: 5m |
| 5 | + |
| 6 | +issues: |
| 7 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 8 | + max-issues-per-linter: 0 |
| 9 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 10 | + max-same-issues: 0 |
| 11 | + |
| 12 | + # We want to try and improve the comments in the k6 codebase, so individual |
| 13 | + # non-golint items from the default exclusion list will gradually be added |
| 14 | + # to the exclude-rules below |
| 15 | + exclude-use-default: false |
| 16 | + |
| 17 | + exclude-rules: |
| 18 | + # Exclude duplicate code and function length and complexity checking in test |
| 19 | + # files (due to common repeats and long functions in test code) |
| 20 | + - path: _(test|gen)\.go |
| 21 | + linters: |
| 22 | + - cyclop |
| 23 | + - dupl |
| 24 | + - gocognit |
| 25 | + - funlen |
| 26 | + - lll |
| 27 | + - path: js\/modules\/k6\/http\/.*_test\.go |
| 28 | + linters: |
| 29 | + # k6/http module's tests are quite complex because they often have several nested levels. |
| 30 | + # The module is in maintainance mode, so we don't intend to port the tests to a parallel version. |
| 31 | + - paralleltest |
| 32 | + - tparallel |
| 33 | + - linters: |
| 34 | + - staticcheck # Tracked in https://github.com/grafana/xk6-grpc/issues/14 |
| 35 | + text: "The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated." |
| 36 | + - linters: |
| 37 | + - forbidigo |
| 38 | + text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden' |
| 39 | + |
| 40 | +linters-settings: |
| 41 | + nolintlint: |
| 42 | + # Disable to ensure that nolint directives don't have a leading space. Default is true. |
| 43 | + allow-leading-space: false |
| 44 | + exhaustive: |
| 45 | + default-signifies-exhaustive: true |
| 46 | + govet: |
| 47 | + check-shadowing: true |
| 48 | + cyclop: |
| 49 | + max-complexity: 25 |
| 50 | + maligned: |
| 51 | + suggest-new: true |
| 52 | + dupl: |
| 53 | + threshold: 150 |
| 54 | + goconst: |
| 55 | + min-len: 10 |
| 56 | + min-occurrences: 4 |
| 57 | + funlen: |
| 58 | + lines: 80 |
| 59 | + statements: 60 |
| 60 | + forbidigo: |
| 61 | + forbid: |
| 62 | + - '^(fmt\\.Print(|f|ln)|print|println)$' |
| 63 | + # Forbid everything in os, except os.Signal and os.SyscalError |
| 64 | + - '^os\.(.*)$(# Using anything except Signal and SyscallError from the os package is forbidden )?' |
| 65 | + # Forbid everything in syscall except the uppercase constants |
| 66 | + - '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?' |
| 67 | + - '^logrus\.Logger$' |
22 | 68 |
|
23 | 69 | linters:
|
24 |
| - presets: |
25 |
| - - bugs |
26 |
| - - style |
27 |
| - - unused |
28 |
| - - complexity |
29 |
| - - format |
30 |
| - - performance |
| 70 | + disable-all: true |
31 | 71 | enable:
|
| 72 | + - asasalint |
| 73 | + - asciicheck |
| 74 | + - bidichk |
| 75 | + - bodyclose |
| 76 | + - contextcheck |
| 77 | + - cyclop |
| 78 | + - dogsled |
| 79 | + - dupl |
| 80 | + - durationcheck |
| 81 | + - errcheck |
| 82 | + - errchkjson |
| 83 | + - errname |
| 84 | + - errorlint |
| 85 | + - exhaustive |
32 | 86 | - exportloopref
|
33 |
| - disable: |
34 |
| - - nolintlint |
35 |
| - - exhaustivestruct |
| 87 | + - forbidigo |
| 88 | + - forcetypeassert |
| 89 | + - funlen |
| 90 | + - gocheckcompilerdirectives |
36 | 91 | - gochecknoglobals
|
37 |
| - - gochecknoinits |
| 92 | + - gocognit |
| 93 | + - goconst |
| 94 | + - gocritic |
| 95 | + - gofmt |
| 96 | + - gofumpt |
| 97 | + - goimports |
| 98 | + - gomoddirectives |
| 99 | + - goprintffuncname |
| 100 | + - gosec |
| 101 | + - gosimple |
| 102 | + - govet |
| 103 | + - importas |
| 104 | + - ineffassign |
| 105 | + - interfacebloat |
38 | 106 | - lll
|
39 |
| - - maligned |
40 |
| - - interfacer |
41 |
| - - scopelint |
42 |
| - - wrapcheck |
| 107 | + - makezero |
| 108 | + - misspell |
| 109 | + - nakedret |
| 110 | + - nestif |
| 111 | + - nilerr |
| 112 | + - nilnil |
| 113 | + - noctx |
| 114 | + - nolintlint |
| 115 | + - nosprintfhostport |
| 116 | + - paralleltest |
| 117 | + - prealloc |
| 118 | + - predeclared |
| 119 | + - promlinter |
| 120 | + - revive |
| 121 | + - reassign |
| 122 | + - rowserrcheck |
| 123 | + - sqlclosecheck |
| 124 | + - staticcheck |
| 125 | + - stylecheck |
| 126 | + - tenv |
| 127 | + - tparallel |
| 128 | + - typecheck |
| 129 | + - unconvert |
| 130 | + - unparam |
| 131 | + - unused |
| 132 | + - usestdlibvars |
| 133 | + - wastedassign |
| 134 | + - whitespace |
| 135 | + fast: false |
0 commit comments