|
| 1 | +service: |
| 2 | + # When updating this, also update the version stored in docker/build-tools/Dockerfile in the istio/tools repo. |
| 3 | + golangci-lint-version: 1.49.x # use the fixed version to not introduce new linters unexpectedly |
| 4 | + |
| 5 | +run: |
| 6 | + concurrency: 4 |
| 7 | + # timeout for analysis, e.g. 30s, 5m, default is 1m |
| 8 | + deadline: 20m |
| 9 | + build-tags: |
| 10 | + - integ |
| 11 | + - integfuzz |
| 12 | + # which dirs to skip: they won't be analyzed; |
| 13 | + # can use regexp here: generated.*, regexp is applied on full path; |
| 14 | + # default value is empty list, but next dirs are always skipped independently |
| 15 | + # from this option's value: |
| 16 | + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ |
| 17 | + skip-dirs: |
| 18 | + - genfiles$ |
| 19 | + - vendor$ |
| 20 | + - bin$ |
| 21 | + |
| 22 | + # which files to skip: they will be analyzed, but issues from them |
| 23 | + # won't be reported. Default value is empty list, but there is |
| 24 | + # no need to include all autogenerated files, we confidently recognize |
| 25 | + # autogenerated files. If it's not please let us know. |
| 26 | + skip-files: |
| 27 | + - ".*\\.pb\\.go" |
| 28 | + - ".*\\.gen\\.go" |
| 29 | + |
| 30 | +linters: |
| 31 | + disable-all: true |
| 32 | + enable: |
| 33 | + - unused |
| 34 | + - errcheck |
| 35 | + - exportloopref |
| 36 | + - gocritic |
| 37 | + - gofumpt |
| 38 | + - goimports |
| 39 | + - revive |
| 40 | + - gosimple |
| 41 | + - govet |
| 42 | + - ineffassign |
| 43 | + - lll |
| 44 | + - misspell |
| 45 | + - staticcheck |
| 46 | + - stylecheck |
| 47 | + - typecheck |
| 48 | + - unconvert |
| 49 | + - unparam |
| 50 | + - gci |
| 51 | + - bodyclose |
| 52 | + - gosec |
| 53 | + - asciicheck |
| 54 | + - prealloc |
| 55 | + - predeclared |
| 56 | + - makezero |
| 57 | + fast: false |
| 58 | + |
| 59 | +linters-settings: |
| 60 | + errcheck: |
| 61 | + # report about not checking of errors in type assetions: `a := b.(MyStruct)`; |
| 62 | + # default is false: such cases aren't reported by default. |
| 63 | + check-type-assertions: false |
| 64 | + |
| 65 | + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; |
| 66 | + # default is false: such cases aren't reported by default. |
| 67 | + check-blank: false |
| 68 | + govet: |
| 69 | + # report about shadowed variables |
| 70 | + check-shadowing: false |
| 71 | + maligned: |
| 72 | + # print struct with more effective memory layout or not, false by default |
| 73 | + suggest-new: true |
| 74 | + misspell: |
| 75 | + # Correct spellings using locale preferences for US or UK. |
| 76 | + # Default is to use a neutral variety of English. |
| 77 | + # Setting locale to US will correct the British spelling of 'colour' to 'color'. |
| 78 | + locale: US |
| 79 | + ignore-words: |
| 80 | + - cancelled |
| 81 | + - marshalled |
| 82 | + lll: |
| 83 | + # max line length, lines longer will be reported. Default is 120. |
| 84 | + # '\t' is counted as 1 character by default, and can be changed with the tab-width option |
| 85 | + line-length: 160 |
| 86 | + # tab width in spaces. Default to 1. |
| 87 | + tab-width: 1 |
| 88 | + gocritic: |
| 89 | + disabled-checks: |
| 90 | + - exitAfterDefer |
| 91 | + unused: |
| 92 | + check-exported: false |
| 93 | + unparam: |
| 94 | + # Inspect exported functions, default is false. Set to true if no external program/library imports your code. |
| 95 | + # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: |
| 96 | + # if it's called for subdir of a project it can't find external interfaces. All text editor integrations |
| 97 | + # with golangci-lint call it on a directory with the changed file. |
| 98 | + check-exported: false |
| 99 | + gci: |
| 100 | + sections: |
| 101 | + - standard |
| 102 | + - default |
| 103 | + - prefix(github.com/fatedier/frp/) |
| 104 | + gosec: |
| 105 | + severity: "low" |
| 106 | + confidence: "low" |
| 107 | + excludes: |
| 108 | + - G102 |
| 109 | + - G112 |
| 110 | + - G306 |
| 111 | + - G401 |
| 112 | + - G402 |
| 113 | + - G404 |
| 114 | + - G501 |
| 115 | + |
| 116 | +issues: |
| 117 | + # List of regexps of issue texts to exclude, empty list by default. |
| 118 | + # But independently from this option we use default exclude patterns, |
| 119 | + # it can be disabled by `exclude-use-default: false`. To list all |
| 120 | + # excluded by default patterns execute `golangci-lint run --help` |
| 121 | + # exclude: |
| 122 | + # - composite literal uses unkeyed fields |
| 123 | + |
| 124 | + exclude-rules: |
| 125 | + # Exclude some linters from running on test files. |
| 126 | + - path: _test\.go$|^tests/|^samples/ |
| 127 | + linters: |
| 128 | + - errcheck |
| 129 | + - maligned |
| 130 | + |
| 131 | + # Independently from option `exclude` we use default exclude patterns, |
| 132 | + # it can be disabled by this option. To list all |
| 133 | + # excluded by default patterns execute `golangci-lint run --help`. |
| 134 | + # Default value for this option is true. |
| 135 | + exclude-use-default: true |
| 136 | + |
| 137 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 138 | + max-per-linter: 0 |
| 139 | + |
| 140 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 141 | + max-same-issues: 0 |
0 commit comments