-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #354 from shelter2759/use-buf-lint
multi: Modify buf.yaml for Buf lint and Format with Buf CLI Comamnd("buf format -w")
- Loading branch information
Showing
7 changed files
with
296 additions
and
204 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Usage Guide | ||
|
||
In this project, we utilize Buf CLI to streamline the development environment for Protocol Buffers (protobuf).Buf is a powerful tool for managing the build, linting, formatting, and validation processes for protobuf files in a consistent and efficient manner. | ||
|
||
- [Buf](https://buf.build/) | ||
- [Buf Github URL](https://github.com/bufbuild/buf) | ||
|
||
## Why We Use Buf | ||
|
||
The adoption of Buf provides several advantages: | ||
- Strict Lint Checks: Ensures a consistent code style across the team and helps prevent potential bugs. | ||
- Simplified Build Process: Reduces the complexity of configuring protoc commands with multiple options. | ||
- CI/CD Integration: Easily integrates automatic linting, formatting, and validation into the CI/CD pipeline. | ||
- Module Management: Simplifies dependency management with Buf modules. | ||
|
||
## Installation Instructions | ||
|
||
Buf CLI setup guide see this [Install the Buf CLI](https://buf.build/docs/cli/installation/): | ||
|
||
## Notes on commands | ||
|
||
```bash | ||
make buf-lint ## lint | ||
make buf-format ## format -w | ||
``` |
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ ARG GRPC_GATEWAY_VERSION | |
ENV PROTOC_GEN_GO_GRPC_VERSION="v1.1.0" | ||
ENV GOCACHE=/tmp/build/.cache | ||
ENV GOMODCACHE=/tmp/build/.modcache | ||
ENV GOBIN=/usr/local/bin | ||
|
||
RUN echo ${PROTOC_GEN_VERSION} | ||
|
||
|
@@ -21,7 +22,7 @@ RUN cd /tmp \ | |
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} \ | ||
&& go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION} \ | ||
&& go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${GRPC_GATEWAY_VERSION} \ | ||
&& GOBIN=/usr/local/bin go install github.com/bufbuild/buf/cmd/[email protected] \ | ||
&& go install github.com/bufbuild/buf/cmd/[email protected] \ | ||
&& chmod -R 777 /tmp/build/ | ||
|
||
WORKDIR /build | ||
|
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
Oops, something went wrong.