-
Notifications
You must be signed in to change notification settings - Fork 362
Expand file tree
/
Copy path.golangci.yml
More file actions
141 lines (137 loc) · 5 KB
/
Copy path.golangci.yml
File metadata and controls
141 lines (137 loc) · 5 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
version: "2"
run:
timeout: 5m
allow-parallel-runners: true
formatters:
enable:
- goimports
- gofmt
linters:
enable:
- importas
- bodyclose
- copyloopvar
- dupword
- durationcheck
- errcheck
- fatcontext
- forbidigo
- ginkgolinter
- goconst
- gocritic
- govet
- ineffassign
- loggercheck
- makezero
- misspell
- nakedret
- nilnil
- perfsprint
- prealloc
- revive
- staticcheck
- unparam
- unused
- unconvert
exclusions:
presets:
- comments # suppress missing comment violations on packages and exported symbols
- std-error-handling # suppress unchecked errors on well-known stdlib patterns (e.g. Close())
rules:
# Package names inherited from GAIE upstream (common, types, utils, http) are intentional
- linters: [revive]
text: "avoid meaningless package names"
- linters: [revive]
text: "avoid package names that conflict with Go standard library package names"
# This alias adds no clarity (v1 disambiguates nothing) but goimports
# always writes it: it computes v1's "assumed name" by skipping the
# version segment (landing on the parent directory name), sees that
# differs from the real package name, and pins an explicit alias to
# keep the two in sync. Excluded only because make format and make
# lint would otherwise fight forever, not because the alias helps.
- linters: [revive]
text: 'Import alias "v[0-9]+((alpha|beta)[0-9]+)?" is redundant'
# Packages transferred verbatim from llm-d-kv-cache (#1862); style cleanup tracked separately
- path: pkg/(kvcache|kvevents)/
linters:
- revive
- perfsprint
- goconst
- dupword
- prealloc
# The panic ban applies only to pkg/epp/flowcontrol (non-test files); see that package's doc.go.
- path-except: pkg/epp/flowcontrol/
linters:
- forbidigo
- path: _test\.go$
linters:
- forbidigo
settings:
forbidigo:
forbid:
- pattern: ^panic$
msg: "pkg/epp/flowcontrol is panic-free by design (see its doc.go); validate at the boundary and return an error"
importas:
no-unaliased: false # unaliased imports are allowed; only enforce when an alias is used
alias:
- pkg: github.com/llm-d/llm-d-router/pkg/epp/framework/interface/scheduling
alias: fwksched
- pkg: github.com/llm-d/llm-d-router/pkg/epp/framework/interface/requestcontrol
alias: fwkrc
- pkg: github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol
alias: fwkfc
- pkg: github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol/mocks
alias: fwkfcmocks
- pkg: github.com/llm-d/llm-d-router/pkg/epp/framework/interface/plugin
alias: fwkplugin
- pkg: github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/datalayer/attribute/prefix
alias: attrprefix
- pkg: github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/datalayer/extractor/metrics
alias: extractormetrics
- pkg: github.com/llm-d/llm-d-router/pkg/epp/framework/plugins/datalayer/source/metrics
alias: sourcemetrics
- pkg: github.com/llm-d/llm-d-router/pkg/epp/util/pool
alias: poolutil
- pkg: github.com/llm-d/llm-d-router/pkg/epp/util/testing
alias: testutil
- pkg: github.com/llm-d/llm-d-router/pkg/common/error
alias: errcommon
- pkg: github.com/llm-d/llm-d-router/test/utils/igw
alias: igwtestutils
- pkg: github.com/llm-d/llm-d-router/test/framework/net
alias: fwknet
- pkg: github.com/llm-d/llm-d-router/test/framework/context
alias: fwkcontext
- pkg: github.com/llm-d/llm-d-router/test/framework/k8s
alias: fwkk8s
- pkg: github.com/llm-d/llm-d-router/test/framework/gaie
alias: fwkgaie
- pkg: github.com/llm-d/llm-d-router/test/framework/epp
alias: fwkepp
revive: # see https://github.com/mgechev/revive#available-rules for all options
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: errorf
- name: if-return
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: redundant-import-alias
- name: time-naming
- name: unexported-return
- name: var-declaration
- name: var-naming
issues:
# do not limit the number of issues, ensure even identical are reported
max-issues-per-linter: 0
max-same-issues: 0
# Note: 'new' setting is controlled via Makefile LINT_NEW_ONLY variable
# Set to true to only check new code, false (default) to check all code