Skip to content

Commit 3dd0eb5

Browse files
authored
feat(build): add make lint target (filecoin-project#12886)
1 parent 5f0f585 commit 3dd0eb5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/check.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ jobs:
4646
- uses: ./.github/actions/install-system-dependencies
4747
- uses: ./.github/actions/install-go
4848
- uses: ./.github/actions/make-deps
49-
- run: go install github.com/golangci/golangci-lint/cmd/[email protected]
50-
- run: golangci-lint run -v --timeout 10m --concurrency 4
49+
- run: make lint
5150
check-fmt:
5251
name: Check (gofmt)
5352
runs-on: ubuntu-latest

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ $(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell
1616
$(error Update Golang to version to at least $(shell cat GO_VERSION_MIN))
1717
endif
1818

19+
GOLANGCI_LINT_VERSION=v1.59.0
20+
1921
# git modules that need to be loaded
2022
MODULES:=
2123

@@ -283,6 +285,12 @@ unittests: ## Run unit tests
283285
@$(GOCC) test $(shell go list ./... | grep -v /lotus/itests)
284286
.PHONY: unittests
285287

288+
lint:
289+
go mod tidy
290+
go vet ./...
291+
go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --timeout 10m --concurrency 4
292+
.PHONY: lint
293+
286294
clean: ## Clean build artifacts
287295
rm -rf $(CLEAN) $(BINS)
288296
-$(MAKE) -C $(FFI_PATH) clean

0 commit comments

Comments
 (0)