-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yaml
111 lines (100 loc) · 3.11 KB
/
.golangci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Copyright (c) Volvo Car AB
# SPDX-License-Identifier: Apache-2.0
#TODO: adapt to new config: https://golangci-lint.run/usage/configuration/
run:
# concurrency: 4
timeout: 20m
go: "1.23.0"
linters:
disable-all: true
enable:
- unused
- errcheck
- gocritic
- gofumpt
- goimports
- revive
- gosimple
- govet
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- gosec
- asciicheck
- prealloc
- predeclared
fast: false
linters-settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false
# gocritic:
# disabled-checks:
# - exitAfterDefer
gofumpt:
# Module path which contains the source code being formatted.
module-path: github.com/golingon/lingon
# Choose whether to use the extra rules.
# Default: false
extra-rules: true
gosec:
excludes:
- G102 # Bind to all interfaces
- G115 # Potential integer overflow when converting between integer types
- G204 # Audit use of command execution
- G306 # Poor file permissions used when writing to a new file
- G404 # Insecure random number source (rand)
severity: "low"
confidence: "low"
nolintlint:
# Disable to ensure that all nolint directives actually have an effect.
# Default: false
allow-unused: false
# Exclude following linters from requiring an explanation.
# Default: []
allow-no-explanation: []
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
require-explanation: true
# Enable to require nolint directives to mention the specific linter being suppressed.
# Default: false
require-specific: true
revive:
rules:
- name: increment-decrement
severity: warning
disabled: false
issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently of this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
# exclude:
# - composite literal uses unkeyed fields
exclude-rules:
# Exclude some linters from running on test files.
- path: _test\.go$|^tests/|^samples/
linters:
- errcheck
- maligned
# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: true
exclude-dirs:
- genfiles$
- vendor$
- bin$
exclude-files:
- ".*\\.pb\\.go"
- ".*\\.gen\\.go"
- pkg/kubeconfig/types-k8s.go
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0