-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
60 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,12 @@ endif | |
|
||
.PHONY: init | ||
# init env | ||
init: | ||
init: init-lint | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
go install github.com/go-kratos/kratos/cmd/kratos/v2@latest | ||
|
||
init-lint: | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
init-test: | ||
|
@@ -48,17 +50,17 @@ lint: lint-pkgs lint-root | |
|
||
lint-root: | ||
@echo "linting root package" | ||
@golangci-lint run --fix | ||
@golangci-lint run # re-run to make sure fixes are valid, useful in some condition | ||
@golangci-lint run --fix --timeout 5m | ||
@golangci-lint run --timeout 5m # re-run to make sure fixes are valid, useful in some condition | ||
|
||
lint-pkgs: | ||
@for d in pkg/*; do \ | ||
if [ -d "$$d" ]; then \ | ||
cd $$d; \ | ||
echo "linting $$d"; \ | ||
go mod tidy; \ | ||
golangci-lint run -c ../../.golangci.yml --fix; \ | ||
golangci-lint run -c ../../.golangci.yml; \ | ||
golangci-lint run -c ../../.golangci.yml --fix --timeout 5m; \ | ||
golangci-lint run -c ../../.golangci.yml --timeout 5m; \ | ||
cd ../../; \ | ||
fi \ | ||
done | ||
|