Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 7fa8ed3

Browse files
committed
Use golangci rather than deprecated metalinter for lint checks.
1 parent 38ecc67 commit 7fa8ed3

File tree

5 files changed

+53
-27
lines changed

5 files changed

+53
-27
lines changed

.golangci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
run:
2+
deadline: 5m
3+
issues-exit-code: 1
4+
tests: true
5+
6+
output:
7+
format: colored-line-number
8+
print-issued-lines: true
9+
print-linter-name: true
10+
11+
linters:
12+
enable:
13+
- deadcode
14+
- errcheck
15+
- goimports
16+
- gofmt
17+
- golint
18+
- govet
19+
- ineffassign
20+
- misspell
21+
- structcheck
22+
- unconvert
23+
- varcheck
24+
- interfacer
25+
- unparam
26+
- depguard
27+
- goconst
28+
- gocyclo
29+
- gosec
30+
- maligned
31+
- prealloc
32+
disable:
33+
# - nakedret
34+
# - gosimple
35+
# - staticcheck
36+
# - stylecheck
37+
# - unused
38+
# - dupl
39+
# - gochecknoinits
40+
# - gochecknoglobals
41+
# - lll
42+
# - typecheck
43+
enable-all: false
44+
disable-all: true

GNUmakefile

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ default: check test build
44
tools: ## Install the tools used to test and build
55
@echo "==> Installing build tools"
66
go get github.com/ahmetb/govvv
7-
go get github.com/alecthomas/gometalinter
8-
gometalinter --install
7+
GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
98

109
.PHONY: build
1110
build: ## Build Levant for development purposes
@@ -29,26 +28,9 @@ release: ## Trigger the release build script
2928
@goreleaser --rm-dist
3029

3130
.PHONY: check
32-
check: ## Run the gometalinter suite
31+
check: ## Run golangci-lint
3332
@echo "==> Running $@..."
34-
gometalinter \
35-
--deadline 10m \
36-
--vendor \
37-
--sort="path" \
38-
--aggregate \
39-
--disable-all \
40-
--enable golint \
41-
--enable-gc \
42-
--enable goimports \
43-
--enable misspell \
44-
--enable vet \
45-
--enable deadcode \
46-
--enable varcheck \
47-
--enable ineffassign \
48-
--enable structcheck \
49-
--enable errcheck \
50-
--enable gofmt \
51-
./...
33+
golangci-lint run buildtime/... client/... command/... helper/... levant/... logging/... scale/... template/... version/...
5234

5335
HELP_FORMAT=" \033[36m%-25s\033[0m %s\n"
5436
.PHONY: help

levant/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (l *levantDeployment) deploymentWatcher(depID string) (success bool) {
274274
deploymentChan := make(chan interface{})
275275

276276
t := time.Now()
277-
wt := time.Duration(5 * time.Second)
277+
wt := 5 * time.Second
278278

279279
// Setup the canaryChan and launch the autoPromote go routine if autoPromote
280280
// has been enabled.

levant/job_status_checker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (l *levantDeployment) jobStatusChecker(evalID *string) bool {
2121

2222
// Run the initial job status check to ensure the job reaches a state of
2323
// running.
24-
jStatus := l.simpleJobStatusChecker(*l.config.Template.Job.ID)
24+
jStatus := l.simpleJobStatusChecker()
2525

2626
// Periodic and parameterized batch jobs do not produce evaluations and so
2727
// can only go through the simplest of checks.
@@ -40,7 +40,7 @@ func (l *levantDeployment) jobStatusChecker(evalID *string) bool {
4040

4141
// simpleJobStatusChecker is used to check that jobs which do not emit initial
4242
// evaluations at least reach a job status of running.
43-
func (l *levantDeployment) simpleJobStatusChecker(jobID string) bool {
43+
func (l *levantDeployment) simpleJobStatusChecker() bool {
4444

4545
q := &nomad.QueryOptions{WaitIndex: 1}
4646

levant/structs/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ type DeployConfig struct {
3939
// and force the count based on the rendered job file.
4040
ForceCount bool
4141

42-
// VaultToken is a string with the vault token.
43-
VaultToken string
44-
4542
// EnvVault is a boolean flag that can be used to enable reading the VAULT_TOKEN
4643
// from the enviromment.
4744
EnvVault bool
45+
46+
// VaultToken is a string with the vault token.
47+
VaultToken string
4848
}
4949

5050
// ClientConfig is the config struct which houses all the information needed to connect

0 commit comments

Comments
 (0)