Skip to content

Commit 1d242bc

Browse files
author
Takashi Kusumi
authored
Integrate fmt and vet checks into golangci-lint (#260)
* Fix gofmt issues * Integrate fmt and vet checks into golangci-lint
1 parent 9e833da commit 1d242bc

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

.golangci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
run:
2+
timeout: 5m
3+
linters:
4+
disable-all: true
5+
enable:
6+
- errcheck
7+
- gofmt
8+
- gosimple
9+
- govet
10+
- ineffassign
11+
- staticcheck
12+
- typecheck
13+
- unused

Makefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,16 @@ build-cross: $(GORELEASER)
3131
$(GORELEASER) build --snapshot --clean
3232

3333
.PHONY: test
34-
test: fmt vet lint
34+
test: lint
3535
go test -v ./...
3636

3737
.PHONY: lint
3838
lint: $(GOLANGCI_LINT)
3939
$(GOLANGCI_LINT) run
4040

41-
.PHONY: fmt
42-
fmt:
43-
go fmt ./...
44-
45-
.PHONY: vet
46-
vet:
47-
go vet ./...
41+
.PHONY: lint-fix
42+
lint-fix: $(GOLANGCI_LINT)
43+
$(GOLANGCI_LINT) run --fix
4844

4945
README_FILE ?= ./README.md
5046

cmd/flag_completion.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ import (
3030
)
3131

3232
var flagChoices = map[string][]string{
33-
"color": []string{"always", "never", "auto"},
34-
"completion": []string{"bash", "zsh", "fish"},
35-
"container-state": []string{stern.RUNNING, stern.WAITING, stern.TERMINATED, stern.ALL_STATES},
36-
"output": []string{"default", "raw", "json", "extjson", "ppextjson"},
37-
"timestamps": []string{"default", "short"},
33+
"color": {"always", "never", "auto"},
34+
"completion": {"bash", "zsh", "fish"},
35+
"container-state": {stern.RUNNING, stern.WAITING, stern.TERMINATED, stern.ALL_STATES},
36+
"output": {"default", "raw", "json", "extjson", "ppextjson"},
37+
"timestamps": {"default", "short"},
3838
}
3939

4040
func runCompletion(shell string, cmd *cobra.Command, out io.Writer) error {

0 commit comments

Comments
 (0)