Skip to content

Commit

Permalink
Integrate fmt and vet checks into golangci-lint (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
superbrothers authored Apr 16, 2023
1 parent 7109743 commit 3df71f0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions .golangci.yaml
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
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
Expand Down

0 comments on commit 3df71f0

Please sign in to comment.