diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 209bce3..535a832 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,6 @@ jobs: go-version-file: go.mod - name: Ensure go.mod is already tidied run: go mod tidy && git diff -s --exit-code go.sum - - run: make vet fmt lint test + - run: make lint test - run: make dist - run: make validate-krew-manifest diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..19ea664 --- /dev/null +++ b/.golangci.yaml @@ -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 e4b5314..c5aa3c5 100644 --- a/Makefile +++ b/Makefile @@ -31,18 +31,14 @@ $(GORELEASER_FILTER): build-cross: $(GORELEASER) $(GORELEASER) build --snapshot --clean -.PHONY: vet -vet: - $(GO) vet ./... - -.PHONY: fmt -fmt: - $(GO) fmt ./... - .PHONY: lint -lint: vet fmt $(GOLANGCI_LINT) +lint: $(GOLANGCI_LINT) $(GOLANGCI_LINT) run +.PHONY: lint-fix +lint-fix: $(GOLANGCI_LINT) + $(GOLANGCI_LINT) run --fix + .PHONY: test test: $(GO) test -v ./...