From 2acaa6e61db64e1c34e2dbcab8441d8ef0f7d8fd Mon Sep 17 00:00:00 2001 From: Chris Grindstaff Date: Mon, 2 Dec 2024 11:44:36 -0500 Subject: [PATCH] ci: add misspell, nakedret, and predeclared linter --- .golangci.yml | 5 ++++- cmd/poller/collector/helpers.go | 4 ++-- cmd/poller/plugin/{max => maxplugin}/max.go | 2 +- cmd/tools/template/template.go | 2 +- integration/go.mod | 2 +- integration/go.sum | 4 ++-- 6 files changed, 11 insertions(+), 8 deletions(-) rename cmd/poller/plugin/{max => maxplugin}/max.go (99%) diff --git a/.golangci.yml b/.golangci.yml index 41fd4c815..c7142daa8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,12 +26,15 @@ linters: - intrange - makezero - mirror + - misspell + - nakedret - nilerr - nolintlint - nonamedreturns - nosprintfhostport - perfsprint - prealloc + - predeclared - reassign - recvcheck - revive @@ -39,9 +42,9 @@ linters: - staticcheck - stylecheck - tenv + - testableexamples - testifylint - thelper - - testableexamples - typecheck - unconvert - unparam diff --git a/cmd/poller/collector/helpers.go b/cmd/poller/collector/helpers.go index 431b68ce4..ac6a125ec 100644 --- a/cmd/poller/collector/helpers.go +++ b/cmd/poller/collector/helpers.go @@ -14,7 +14,7 @@ import ( "github.com/netapp/harvest/v2/cmd/poller/plugin/aggregator" "github.com/netapp/harvest/v2/cmd/poller/plugin/changelog" "github.com/netapp/harvest/v2/cmd/poller/plugin/labelagent" - "github.com/netapp/harvest/v2/cmd/poller/plugin/max" + "github.com/netapp/harvest/v2/cmd/poller/plugin/maxplugin" "github.com/netapp/harvest/v2/cmd/poller/plugin/metricagent" "github.com/netapp/harvest/v2/pkg/conf" "github.com/netapp/harvest/v2/pkg/errs" @@ -222,7 +222,7 @@ func GetBuiltinPlugin(name string, abc *plugin.AbstractPlugin) plugin.Plugin { } if name == "Max" { - return max.New(abc) + return maxplugin.New(abc) } if name == "LabelAgent" { diff --git a/cmd/poller/plugin/max/max.go b/cmd/poller/plugin/maxplugin/max.go similarity index 99% rename from cmd/poller/plugin/max/max.go rename to cmd/poller/plugin/maxplugin/max.go index 7609a9198..58668df6f 100644 --- a/cmd/poller/plugin/max/max.go +++ b/cmd/poller/plugin/maxplugin/max.go @@ -2,7 +2,7 @@ * Copyright NetApp Inc, 2022 All rights reserved */ -package max +package maxplugin import ( "github.com/netapp/harvest/v2/cmd/poller/plugin" diff --git a/cmd/tools/template/template.go b/cmd/tools/template/template.go index 11ccd5f11..c69470ddd 100644 --- a/cmd/tools/template/template.go +++ b/cmd/tools/template/template.go @@ -7,7 +7,7 @@ import ( "github.com/netapp/harvest/v2/cmd/poller/plugin" "github.com/netapp/harvest/v2/cmd/poller/plugin/aggregator" "github.com/netapp/harvest/v2/cmd/poller/plugin/labelagent" - max2 "github.com/netapp/harvest/v2/cmd/poller/plugin/max" + max2 "github.com/netapp/harvest/v2/cmd/poller/plugin/maxplugin" "github.com/netapp/harvest/v2/cmd/poller/plugin/metricagent" "github.com/netapp/harvest/v2/pkg/conf" "github.com/netapp/harvest/v2/pkg/errs" diff --git a/integration/go.mod b/integration/go.mod index c11c28dac..846c08c1a 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -25,7 +25,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/shirou/gopsutil/v4 v4.24.10 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tidwall/match v1.1.1 // indirect diff --git a/integration/go.sum b/integration/go.sum index 18cc66c2c..08404c137 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -39,8 +39,8 @@ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v4 v4.24.10 h1:7VOzPtfw/5YDU+jLEoBwXwxJbQetULywoSV4RYY7HkM= -github.com/shirou/gopsutil/v4 v4.24.10/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=