This is an automated email from the ASF dual-hosted git repository.
lujiajing pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
The following commit(s) were added to refs/heads/main by this push:
new df1ec32 Install golangci-lint by go install (#140)
df1ec32 is described below
commit df1ec32791eaa77410f89227583a38a26b402845
Author: Gao Hongtao <[email protected]>
AuthorDate: Wed Jun 29 16:27:46 2022 +0800
Install golangci-lint by go install (#140)
* Install golangci-lint by go install
* Fix invalid checks in pre-push
* Remove clean from check
Signed-off-by: Gao Hongtao <[email protected]>
---
Makefile | 13 ++++++++-----
scripts/build/lint-api.mk | 8 ++------
scripts/build/lint-bin.mk | 4 ++++
scripts/build/lint-deprecated.mk | 8 ++------
scripts/build/lint.mk | 8 +-------
5 files changed, 17 insertions(+), 24 deletions(-)
diff --git a/Makefile b/Makefile
index a5999d7..fbe9237 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,6 @@ clean: default ## Clean artifacts in all projects
generate: TARGET=generate
generate: PROJECTS:=api $(PROJECTS) pkg
generate: default ## Generate API codes
- @$(MAKE) format
build: TARGET=all
build: default ## Build all projects
@@ -75,8 +74,8 @@ format: PROJECTS:=api $(PROJECTS) pkg scripts/ci/check
format: tidy
format: default ## Run the linters on all projects
-## Check that the status is consistent with CI.
-check: clean
+
+check: ## Check that the status is consistent with CI
$(MAKE) -C scripts/ci/check test
$(MAKE) -C ui check-version
$(MAKE) license-dep
@@ -91,7 +90,11 @@ check: clean
exit 1; \
fi
-pre-push: generate lint license-check check ## Check source files before
pushing to the remote repo
+pre-push: ## Check source files before pushing to the remote repo
+ $(MAKE) generate
+ $(MAKE) lint
+ $(MAKE) license-check
+ $(MAKE) check
##@ License targets
@@ -160,7 +163,7 @@ release-assembly: release-binary release-sign ## Generate
release package
.PHONY: all $(PROJECTS) clean build default nuke
-.PHONY: lint check tidy format pre-commit
+.PHONY: lint check tidy format pre-push
.PHONY: test test-race test-coverage
.PHONY: license-check license-fix license-dep
.PHONY: release release-binary release-source release-sign release-assembly
diff --git a/scripts/build/lint-api.mk b/scripts/build/lint-api.mk
index a2e40c2..d58f8d0 100644
--- a/scripts/build/lint-api.mk
+++ b/scripts/build/lint-api.mk
@@ -16,15 +16,11 @@
# under the License.
#
-GOLANGCI_VERSION := v1.46.2
-
LINT_OPTS ?= --timeout 1m0s
-##@ Code quality targets
+include $(mk_dir)lint-bin.mk
-LINTER := $(tool_bin)/golangci-lint
-$(LINTER):
- @wget -O - -q
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh
-s -- -b $(root_dir)/bin $(GOLANGCI_VERSION)
+##@ Code quality targets
.PHONY: lint
lint: $(LINTER)
diff --git a/scripts/build/lint-bin.mk b/scripts/build/lint-bin.mk
new file mode 100644
index 0000000..f29b241
--- /dev/null
+++ b/scripts/build/lint-bin.mk
@@ -0,0 +1,4 @@
+
+LINTER := $(tool_bin)/golangci-lint
+$(LINTER):
+ @GOBIN=$(tool_bin) go install
github.com/golangci/golangci-lint/cmd/[email protected]
diff --git a/scripts/build/lint-deprecated.mk b/scripts/build/lint-deprecated.mk
index 6c9d90e..e9ee439 100644
--- a/scripts/build/lint-deprecated.mk
+++ b/scripts/build/lint-deprecated.mk
@@ -16,15 +16,11 @@
# under the License.
#
-GOLANGCI_VERSION := v1.46.2
-
LINT_OPTS ?= --timeout 1m0s
-##@ Code quality targets
+include $(mk_dir)lint-bin.mk
-LINTER := $(tool_bin)/golangci-lint
-$(LINTER):
- @wget -O - -q
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh
-s -- -b $(root_dir)/bin $(GOLANGCI_VERSION)
+##@ Code quality targets
.PHONY: lint
lint: $(LINTER)
diff --git a/scripts/build/lint.mk b/scripts/build/lint.mk
index e52df5a..ccf33fd 100644
--- a/scripts/build/lint.mk
+++ b/scripts/build/lint.mk
@@ -16,16 +16,10 @@
# under the License.
#
-GOLANGCI_VERSION := v1.46.2
-
-LINT_OPTS ?= --timeout 1m0s
+include $(mk_dir)lint-bin.mk
##@ Code quality targets
-LINTER := $(tool_bin)/golangci-lint
-$(LINTER):
- @wget -O - -q
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh
-s -- -b $(root_dir)/bin $(GOLANGCI_VERSION)
-
REVIVE := $(tool_bin)/revive
$(REVIVE):
@GOBIN=$(tool_bin) go install github.com/mgechev/revive@latest