Skip to content

Commit 3df71f0

Browse files
Integrate fmt and vet checks into golangci-lint (#69)
1 parent 7109743 commit 3df71f0

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
go-version-file: go.mod
1919
- name: Ensure go.mod is already tidied
2020
run: go mod tidy && git diff -s --exit-code go.sum
21-
- run: make vet fmt lint test
21+
- run: make lint test
2222
- run: make dist
2323
- run: make validate-krew-manifest

.golangci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
run:
2+
timeout: 5m
3+
linters:
4+
disable-all: true
5+
enable:
6+
- errcheck
7+
- gofmt
8+
- gosimple
9+
- govet
10+
- ineffassign
11+
- staticcheck
12+
- typecheck
13+
- unused

Makefile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,14 @@ $(GORELEASER_FILTER):
3131
build-cross: $(GORELEASER)
3232
$(GORELEASER) build --snapshot --clean
3333

34-
.PHONY: vet
35-
vet:
36-
$(GO) vet ./...
37-
38-
.PHONY: fmt
39-
fmt:
40-
$(GO) fmt ./...
41-
4234
.PHONY: lint
43-
lint: vet fmt $(GOLANGCI_LINT)
35+
lint: $(GOLANGCI_LINT)
4436
$(GOLANGCI_LINT) run
4537

38+
.PHONY: lint-fix
39+
lint-fix: $(GOLANGCI_LINT)
40+
$(GOLANGCI_LINT) run --fix
41+
4642
.PHONY: test
4743
test:
4844
$(GO) test -v ./...

0 commit comments

Comments
 (0)