Skip to content

Commit

Permalink
Integrate fmt and vet checks into golangci-lint (#260)
Browse files Browse the repository at this point in the history
* Fix gofmt issues

* Integrate fmt and vet checks into golangci-lint
  • Loading branch information
tksm committed Apr 14, 2023
1 parent 9e833da commit 1d242bc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
13 changes: 13 additions & 0 deletions .golangci.yml
@@ -0,0 +1,13 @@
run:
timeout: 5m
linters:
disable-all: true
enable:
- errcheck
- gofmt
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
12 changes: 4 additions & 8 deletions Makefile
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions cmd/flag_completion.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 1d242bc

Please sign in to comment.