Skip to content

Commit

Permalink
Merge pull request #83 from NETWAYS/update-linter
Browse files Browse the repository at this point in the history
Update linter config
  • Loading branch information
martialblog authored Feb 8, 2024
2 parents 3d0d7e1 + f52155c commit 22b89c3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
15 changes: 11 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion snmp/snmpwalk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 0 additions & 2 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package main

import "fmt"

// nolint: gochecknoglobals
var (
// These get filled at build time with the proper vaules
version = "development"
commit = "HEAD"
date = "latest"
)

//goland:noinspection GoBoolExpressions
func buildVersion() string {
result := version

Expand Down

0 comments on commit 22b89c3

Please sign in to comment.