diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..19ea664 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,13 @@ +run: + timeout: 5m +linters: + disable-all: true + enable: + - errcheck + - gofmt + - gosimple + - govet + - ineffassign + - staticcheck + - typecheck + - unused diff --git a/Makefile b/Makefile index 0d06aee..f6cf6af 100644 --- a/Makefile +++ b/Makefile @@ -31,20 +31,16 @@ build-cross: $(GORELEASER) $(GORELEASER) build --snapshot --clean .PHONY: test -test: fmt vet lint +test: lint go test -v ./... .PHONY: lint lint: $(GOLANGCI_LINT) $(GOLANGCI_LINT) run -.PHONY: fmt -fmt: - go fmt ./... - -.PHONY: vet -vet: - go vet ./... +.PHONY: lint-fix +lint-fix: $(GOLANGCI_LINT) + $(GOLANGCI_LINT) run --fix README_FILE ?= ./README.md diff --git a/cmd/flag_completion.go b/cmd/flag_completion.go index 697a3a1..7811f53 100644 --- a/cmd/flag_completion.go +++ b/cmd/flag_completion.go @@ -30,11 +30,11 @@ import ( ) var flagChoices = map[string][]string{ - "color": []string{"always", "never", "auto"}, - "completion": []string{"bash", "zsh", "fish"}, - "container-state": []string{stern.RUNNING, stern.WAITING, stern.TERMINATED, stern.ALL_STATES}, - "output": []string{"default", "raw", "json", "extjson", "ppextjson"}, - "timestamps": []string{"default", "short"}, + "color": {"always", "never", "auto"}, + "completion": {"bash", "zsh", "fish"}, + "container-state": {stern.RUNNING, stern.WAITING, stern.TERMINATED, stern.ALL_STATES}, + "output": {"default", "raw", "json", "extjson", "ppextjson"}, + "timestamps": {"default", "short"}, } func runCompletion(shell string, cmd *cobra.Command, out io.Writer) error {