From cd90aa7cba3fa29716ccf465e6a78efb05fa173f Mon Sep 17 00:00:00 2001 From: r2k1 Date: Wed, 26 Jun 2024 18:48:35 +1200 Subject: [PATCH] style: fix lint errors (#4553) fix errors caused by a linter version upgrade --- .golangci.yaml | 5 +++++ pkg/agent/baker.go | 2 -- pkg/agent/bakerapi.go | 2 -- pkg/agent/datamodel/types.go | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index ec05d8805a8..a1924d8a769 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -14,6 +14,11 @@ run: # This file contains only configs which differ from defaults. # All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml linters-settings: + revive: + rules: + - name: dot-imports + disabled: true + cyclop: # The maximal code complexity to report. # Default: 10 diff --git a/pkg/agent/baker.go b/pkg/agent/baker.go index 00915d395e1..d5395967417 100644 --- a/pkg/agent/baker.go +++ b/pkg/agent/baker.go @@ -178,8 +178,6 @@ func (t *TemplateGenerator) getSingleLine(textFilename string, profile interface } // getTemplateFuncMap returns the general purpose template func map from getContainerServiceFuncMap. -// -//nolint:gocognit func getBakerFuncMap(config *datamodel.NodeBootstrappingConfiguration, params paramsMap, variables paramsMap) template.FuncMap { funcMap := getContainerServiceFuncMap(config) diff --git a/pkg/agent/bakerapi.go b/pkg/agent/bakerapi.go index d07e4a1cf78..d0e11bfddb0 100644 --- a/pkg/agent/bakerapi.go +++ b/pkg/agent/bakerapi.go @@ -12,7 +12,6 @@ import ( "github.com/Azure/agentbaker/pkg/agent/vhd/cache" ) -//nolint:revive // Name does not need to be modified to baker type AgentBaker interface { GetNodeBootstrapping(ctx context.Context, config *datamodel.NodeBootstrappingConfiguration) (*datamodel.NodeBootstrapping, error) GetLatestSigImageConfig(sigConfig datamodel.SIGConfig, distro datamodel.Distro, envInfo *datamodel.EnvironmentInfo) (*datamodel.SigImageConfig, error) @@ -26,7 +25,6 @@ type agentBakerImpl struct { var _ AgentBaker = (*agentBakerImpl)(nil) -//nolint:revive // fine to return unexported type due to interface usage func NewAgentBaker() (*agentBakerImpl, error) { return &agentBakerImpl{ toggles: toggles.New(), diff --git a/pkg/agent/datamodel/types.go b/pkg/agent/datamodel/types.go index bd3a280bd05..f7822744e84 100644 --- a/pkg/agent/datamodel/types.go +++ b/pkg/agent/datamodel/types.go @@ -527,9 +527,9 @@ type WindowsProfile struct { AlwaysPullWindowsPauseImage *bool `json:"alwaysPullWindowsPauseImage,omitempty"` ContainerdWindowsRuntimes *ContainerdWindowsRuntimes `json:"containerdWindowsRuntimes,omitempty"` WindowsCalicoPackageURL string `json:"windowsCalicoPackageURL,omitempty"` - //nolint:revive, stylecheck // keep field names the same as RP + //nolint:stylecheck // keep field names the same as RP WindowsSecureTlsEnabled *bool `json:"windowsSecureTlsEnabled,omitempty"` - //nolint:revive, stylecheck // keep field names the same as RP + //nolint:stylecheck // keep field names the same as RP WindowsGmsaPackageUrl string `json:"windowsGmsaPackageUrl,omitempty"` CseScriptsPackageURL string `json:"cseScriptsPackageURL,omitempty"` GpuDriverURL string `json:"gpuDriverUrl,omitempty"` @@ -1335,7 +1335,7 @@ func (w *WindowsProfile) IsAlwaysPullWindowsPauseImage() bool { // IsWindowsSecureTLSEnabled returns true if secure TLS should be enabled for Windows nodes. // -//nolint:revive,stylecheck // allign func name with field name +//nolint:stylecheck // allign func name with field name func (w *WindowsProfile) IsWindowsSecureTlsEnabled() bool { if w.WindowsSecureTlsEnabled != nil { return *w.WindowsSecureTlsEnabled