File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ import (
2525//
2626
2727// Aliased request/response/event types for api/api.proto.
28+ //
29+ //nolint:revive // revive thinks the comment is for the exported type below
2830type (
2931 RegisterPluginRequest = api.RegisterPluginRequest
3032 RegisterPluginResponse = api.Empty
@@ -134,6 +136,8 @@ const (
134136)
135137
136138// Aliased types for api/optional.go.
139+ //
140+ //nolint:revive // revive thinks the comment is for the exported type below
137141type (
138142 OptionalString = api.OptionalString
139143 OptionalInt = api.OptionalInt
Original file line number Diff line number Diff line change @@ -24,13 +24,17 @@ import (
2424
2525// BuiltinPlugin implements the NRI API and runs in-process
2626// within the container runtime.
27+ //
28+ //nolint:revive // tautology builtin.Builtin*
2729type BuiltinPlugin struct {
2830 Base string
2931 Index string
3032 Handlers BuiltinHandlers
3133}
3234
3335// BuiltinHandlers contains request handlers for the builtin plugin.
36+ //
37+ //nolint:revive // tautology builtin.Builtin*
3438type BuiltinHandlers struct {
3539 Configure func (context.Context , * api.ConfigureRequest ) (* api.ConfigureResponse , error )
3640 Synchronize func (context.Context , * api.SynchronizeRequest ) (* api.SynchronizeResponse , error )
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const (
2626 ValidEvents = EventMask ((1 << (Event_LAST - 1 )) - 1 )
2727)
2828
29+ //nolint:revive // exported type should have comment
2930type (
3031 // Define *Request/*Response type aliases for *Event/Empty pairs.
3132
Original file line number Diff line number Diff line change 1414 limitations under the License.
1515*/
1616
17+ // TODO: Add comments to exported methods and functions.
18+ //
19+ //nolint:revive // exported symbols should have comments
1720package api
1821
1922import (
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ func CheckPluginIndex(idx string) error {
5151 if len (idx ) != 2 {
5252 return fmt .Errorf ("invalid plugin index %q, must be 2 digits" , idx )
5353 }
54+ //nolint:staticcheck // could apply De Morgan's law
5455 if ! ('0' <= idx [0 ] && idx [0 ] <= '9' ) || ! ('0' <= idx [1 ] && idx [1 ] <= '9' ) {
5556 return fmt .Errorf ("invalid plugin index %q (not [0-9][0-9])" , idx )
5657 }
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ func (c *LinuxCPU) Strip() *LinuxCPU {
223223 return nil
224224 }
225225
226- empty := true
226+ empty := true //nolint:staticcheck // could merge conditional assignment below to variable definition
227227
228228 if c .Shares != nil {
229229 empty = false
@@ -262,7 +262,7 @@ func (m *LinuxMemory) Strip() *LinuxMemory {
262262 return nil
263263 }
264264
265- empty := true
265+ empty := true //nolint:staticcheck // could merge conditional assignment below to variable definition
266266
267267 if m .Limit != nil {
268268 empty = false
You can’t perform that action at this time.
0 commit comments