diff --git a/.golangci.yml b/.golangci.yml index d83a858..dbef21e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,9 +11,13 @@ issues: - path: 'main.go' linters: - nosnakecase + - funlen - path: 'hp/ilo/firmware.go' linters: - wastedassign + - path: 'snmp/snmpwalk.go' + linters: + - funlen linters: enable-all: true @@ -45,7 +49,10 @@ linters: - varnamelen - wrapcheck linters-settings: - estif: - min-complexity: 4 - maligned: - suggest-new: true + estif: + min-complexity: 4 + maligned: + suggest-new: true + funlen: + statements: 65 + ignore-comments: true diff --git a/Makefile b/Makefile index 241ba61..5ab19f1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: test coverage lint vet build: - go build + export CGO_ENABLED=0; go build lint: go fmt $(go list ./... | grep -v /vendor/) vet: diff --git a/main.go b/main.go index 24eefb8..1297d98 100644 --- a/main.go +++ b/main.go @@ -67,7 +67,6 @@ affected hardware. There is ABSOLUTELY NO WARRANTY, see the license! ` // Check for HP Controller CVEs via SNMP -// nolint: funlen func main() { config := check.NewConfig() config.Name = "check_hp_firmware" diff --git a/snmp/snmpwalk.go b/snmp/snmpwalk.go index 5173323..0ce9b4f 100644 --- a/snmp/snmpwalk.go +++ b/snmp/snmpwalk.go @@ -50,7 +50,6 @@ func ReadWalk(r io.Reader) (pduList WalkData, err error) { return } -// nolint: funlen func ParseWalkLine(line string) (pdu *gosnmp.SnmpPDU, err error) { parts := strings.SplitN(line, " = ", 2) diff --git a/version.go b/version.go index c336dfd..9f91d77 100644 --- a/version.go +++ b/version.go @@ -2,7 +2,6 @@ package main import "fmt" -// nolint: gochecknoglobals var ( // These get filled at build time with the proper vaules version = "development" @@ -10,7 +9,6 @@ var ( date = "latest" ) -//goland:noinspection GoBoolExpressions func buildVersion() string { result := version