Skip to content

Commit

Permalink
golangci-lint: add custom config
Browse files Browse the repository at this point in the history
Add a custom golangci-lint config that enables more linters then the default
Also fix the one issue that was found by revive.
  • Loading branch information
fho committed Sep 7, 2023
1 parent dc0e436 commit 8e9310b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
run:

linters:
disable-all: true
enable:
- bodyclose
- errcheck
- exportloopref
- gocritic
- goimports
- goprintffuncname
- gosimple
- ineffassign
- misspell
- nolintlint
- prealloc
- revive
- staticcheck
- tenv
- typecheck
- unconvert
- unused
- usestdlibvars
- vet

linters-settings:
goimports:
local-prefixes: github.com/simplesurance/jenkins-exporter
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
)

// Version is set during compiliation via -ldflags.
var Version string = "unknown"
var Version = "unknown"

const stateStoreCleanupInterval = 10 * 60 * time.Second

Expand Down

0 comments on commit 8e9310b

Please sign in to comment.