blob: a5fe01fc27eb0d2c7b09d2d0351744e90deb095b [file] [log] [blame]
vinokuma926cb3e2023-03-29 11:41:06 +05301#
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#
mgoudabb017dc2025-10-29 19:53:34 +053015version: "2"
vinokuma926cb3e2023-03-29 11:41:06 +053016linters-settings:
17 govet:
vinokuma926cb3e2023-03-29 11:41:06 +053018 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 Kankanala105581b2024-09-11 05:20:38 +053026 - shadow
vinokuma926cb3e2023-03-29 11:41:06 +053027 - fieldalignment
28
29 golint:
30 min-confidence: 0
31
32 gocyclo:
33 min-complexity: 30
34
35 misspell:
36 locale: US
37
38linters:
39 disable-all: true
40 enable:
41 - govet
42 - errcheck
43 - goconst
vinokuma926cb3e2023-03-29 11:41:06 +053044 - whitespace
vinokuma926cb3e2023-03-29 11:41:06 +053045 - ineffassign
46 - gocyclo
47 - misspell
48 - staticcheck
49 - unused
50 - gosec
mgoudabb017dc2025-10-29 19:53:34 +053051 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
vinokuma926cb3e2023-03-29 11:41:06 +053076
mgoudabb017dc2025-10-29 19:53:34 +053077
78formatters:
79 enable:
80 - gofmt
81 - goimports
vinokuma926cb3e2023-03-29 11:41:06 +053082run:
83 issues-exit-code: 1
84 timeout: 10m
Akash Sonief452f12024-12-12 18:20:28 +053085 skip-files:
86 - _test\.go$
87 skip-dirs:
88 - voltha-go-controller/tests/mocks
89 - internal/test/mocks
vinokuma926cb3e2023-03-29 11:41:06 +053090
91# golangci.com configuration
92# https://github.com/golangci/golangci/wiki/Configuration
93service:
mgoudabb017dc2025-10-29 19:53:34 +053094 golangci-lint-version: 2.2.2 # use the fixed version to not introduce new linters unexpectedly
vinokuma926cb3e2023-03-29 11:41:06 +053095 prepare:
96 - echo "here I can run custom commands, but no preparation needed for this repo"
mgoudabb017dc2025-10-29 19:53:34 +053097# 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