| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2023-present Open Networking Foundation |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # |
| mgouda | bb017dc | 2025-10-29 19:53:34 +0530 | [diff] [blame] | 15 | version: "2" |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 16 | linters-settings: |
| 17 | govet: |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 18 | settings: |
| 19 | printf: |
| 20 | funcs: |
| 21 | - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
| 22 | - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
| 23 | - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
| 24 | - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
| 25 | enable: |
| Akash Reddy Kankanala | 105581b | 2024-09-11 05:20:38 +0530 | [diff] [blame] | 26 | - shadow |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 27 | - fieldalignment |
| 28 | |
| 29 | golint: |
| 30 | min-confidence: 0 |
| 31 | |
| 32 | gocyclo: |
| 33 | min-complexity: 30 |
| 34 | |
| 35 | misspell: |
| 36 | locale: US |
| 37 | |
| 38 | linters: |
| 39 | disable-all: true |
| 40 | enable: |
| 41 | - govet |
| 42 | - errcheck |
| 43 | - goconst |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 44 | - whitespace |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 45 | - ineffassign |
| 46 | - gocyclo |
| 47 | - misspell |
| 48 | - staticcheck |
| 49 | - unused |
| 50 | - gosec |
| mgouda | bb017dc | 2025-10-29 19:53:34 +0530 | [diff] [blame] | 51 | exclusions: |
| 52 | paths: |
| 53 | - '_test\.go$' |
| 54 | - voltha-go-controller/tests/mocks |
| 55 | - internal/test/mocks |
| 56 | rules: |
| 57 | - path: ".*_test.go" |
| 58 | linters: |
| 59 | - govet |
| 60 | - fieldalignment |
| 61 | - text: 'G114: Use of net/http serve function that has no support for setting timeouts' |
| 62 | linters: |
| 63 | - gosec |
| 64 | - text: 'G115: integer overflow conversion' |
| 65 | linters: |
| 66 | - gosec |
| 67 | - text: 'ST1005: error strings should not be capitalized' |
| 68 | linters: |
| 69 | - staticcheck |
| 70 | - text: 'QF1007: could merge conditional assignment into variable declaration' |
| 71 | linters: |
| 72 | - staticcheck |
| 73 | - text: 'QF1008: could remove embedded field' |
| 74 | linters: |
| 75 | - staticcheck |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 76 | |
| mgouda | bb017dc | 2025-10-29 19:53:34 +0530 | [diff] [blame] | 77 | |
| 78 | formatters: |
| 79 | enable: |
| 80 | - gofmt |
| 81 | - goimports |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 82 | run: |
| 83 | issues-exit-code: 1 |
| 84 | timeout: 10m |
| Akash Soni | ef452f1 | 2024-12-12 18:20:28 +0530 | [diff] [blame] | 85 | skip-files: |
| 86 | - _test\.go$ |
| 87 | skip-dirs: |
| 88 | - voltha-go-controller/tests/mocks |
| 89 | - internal/test/mocks |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 90 | |
| 91 | # golangci.com configuration |
| 92 | # https://github.com/golangci/golangci/wiki/Configuration |
| 93 | service: |
| mgouda | bb017dc | 2025-10-29 19:53:34 +0530 | [diff] [blame] | 94 | golangci-lint-version: 2.2.2 # use the fixed version to not introduce new linters unexpectedly |
| vinokuma | 926cb3e | 2023-03-29 11:41:06 +0530 | [diff] [blame] | 95 | prepare: |
| 96 | - echo "here I can run custom commands, but no preparation needed for this repo" |
| mgouda | bb017dc | 2025-10-29 19:53:34 +0530 | [diff] [blame] | 97 | # issues: |
| 98 | # exclude: |
| 99 | # - 'G114: Use of net/http serve function that has no support for setting timeouts' |
| 100 | # - 'G115: integer overflow conversion' |
| 101 | # exclude-rules: |
| 102 | # - path: ".*_test.go" |
| 103 | # linters: |
| 104 | # - govet |
| 105 | # - fieldalignment |