Repository navigation
Expand file tree
/
Copy path.golangci.yml
More file actions
148 lines (148 loc) · 3.96 KB
/
Copy path.golangci.yml
File metadata and controls
148 lines (148 loc) · 3.96 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
version: "2"
run:
build-tags:
- integration
tests: true
linters:
enable:
- bodyclose
- errorlint
- gocritic
- gocyclo
- godot
- gosec
- misspell
- noctx
- prealloc
- revive
- unconvert
- unparam
- whitespace
settings:
errcheck:
check-type-assertions: true
check-blank: true
gocritic:
disabled-checks:
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
enabled-tags:
- diagnostic
- performance
- style
settings:
# aws.Config and similar SDK/config structs are designed to be passed
# by value (the AWS SDK v2 copies Config intentionally). 1024 bytes covers
# these idiomatic large-but-value-typed params without suppressing
# genuinely oversized plain domain structs.
hugeParam:
sizeThreshold: 1024
gocyclo:
min-complexity: 10
# gosec here is a code-hygiene signal, narrower than the enforcing gate
# scripts/run-gosec.sh (CI, pre-commit, Make; all rules, all severities,
# no config file, #nosec honored). Here G104 is excluded, severity and
# confidence are medium+, and the legacy/common-false-positives presets
# drop G301/G302/G304; gosec is also skipped in _test.go (the standalone
# scan omits tests by default). A clean golangci run does not imply a
# clean gosec run.
gosec:
excludes:
- G104
severity: medium
confidence: medium
config:
G101:
ignore_entropy: false
pattern: (?i)passwd|pass|password|pwd|secret|token
govet:
enable-all: true
misspell:
locale: US
revive:
rules:
- name: var-naming
disabled: false
- name: package-comments
disabled: true
- name: exported
disabled: false
- name: indent-error-flow
disabled: false
- name: error-return
disabled: false
- name: error-naming
disabled: false
- name: error-strings
disabled: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- errcheck
- gocritic
- gocyclo
- gosec
path: _test\.go
# unusedwrite: test fixture struct fields may be set for documentation
# completeness even when only a subset of fields is read by a given subtest.
# Scoped to test files so production unusedwrite bugs remain visible.
- linters:
- govet
text: "unusedwrite"
path: _test\.go
# fieldalignment: test-table memory layout is irrelevant, and reordering
# positional table literals risks silent misassignment. Production code
# stays checked.
- linters:
- govet
text: "fieldalignment:"
path: _test\.go
- linters:
- all
path: .*_gen\.go
# noctx: exec.Command calls in configure CLI helpers intentionally
# omit context (CommandRunner interface contract; operator-controlled inputs).
# Suppressed per-file rather than per-line so #nosec G204 can lead the comment.
- linters:
- noctx
path: cmd/configure_(gcp|azure)(_exec|_setup)?\.go
# noctx: http.Get and net.Listen in test helpers appropriately use the
# background context; threading a test context through every helper would
# add noise without improving test correctness.
- linters:
- noctx
path: _test\.go
paths:
- third_party$
- builtin$
- examples$
- node_modules
issues:
max-issues-per-linter: 0
max-same-issues: 0
new: false
severity:
default: warning
rules:
- linters:
- gosec
severity: error
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- node_modules