Skip to content

Commit 79c9a76

Browse files
committed
feat: enable buf lint
Signed-off-by: Mo <kkweon@gmail.com>
1 parent baf1b13 commit 79c9a76

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

.github/workflows/protoc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
with:
2121
go-version: 1.16
2222
- run: make install gen.all
23+
- run: buf lint
2324
- run: |
2425
git update-index --refresh
2526
git diff-index --quiet HEAD -- || { git diff HEAD && echo "::warning::there's diff in generated files. Check your protoc versions."; }

buf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ build:
33
roots:
44
- ./server
55
lint:
6+
allow_comment_ignores: true
67
use:
78
- DEFAULT
9+
except:
10+
- PACKAGE_VERSION_SUFFIX
811
breaking:
912
use:
1013
- FILE

server/pkg/pr12er/service.proto

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
syntax = "proto3";
22
package pkg.pr12er;
33

4-
option go_package = "github.com/codingpot/server/pkg/pr12er";
5-
64
import "pkg/pr12er/messages.proto";
75

8-
message HelloRequest { string body = 1; }
6+
option go_package = "github.com/codingpot/server/pkg/pr12er";
7+
8+
message HelloRequest {
9+
string body = 1;
10+
}
911

10-
message HelloResponse { string body = 1; }
12+
message HelloResponse {
13+
string body = 1;
14+
}
1115

12-
message GetVideosResponse { repeated Video videos = 1; }
16+
message GetVideosResponse {
17+
repeated Video videos = 1;
18+
}
1319

14-
message GetVideosRequest { }
20+
message GetVideosRequest {
21+
}
1522

16-
message GetDetailResponse { Detail detail = 1; }
23+
message GetDetailResponse {
24+
Detail detail = 1;
25+
}
1726

18-
message GetDetailRequest { int32 pr_id = 1; }
27+
message GetDetailRequest {
28+
int32 pr_id = 1;
29+
}
1930

2031
service Pr12erService {
32+
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
33+
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
2134
rpc GetHello(HelloRequest) returns (HelloResponse);
2235
rpc GetVideos(GetVideosRequest) returns (GetVideosResponse);
2336
rpc GetDetail(GetDetailRequest) returns (GetDetailResponse);

0 commit comments

Comments
 (0)