Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate fmt and vet checks into golangci-lint #260

Merged
merged 2 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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