Skip to content

Commit c540262

Browse files
committed
lint: add protolint config
And tidy up the proto definitions to follow the new linting rules. Signed-off-by: Justin Chadwell <[email protected]>
1 parent cab7db2 commit c540262

File tree

10 files changed

+339
-316
lines changed

10 files changed

+339
-316
lines changed

.protolint.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
lint:
2+
directories:
3+
exclude:
4+
- vendor
5+
6+
rules:
7+
no_default: true
8+
9+
add:
10+
# syntax
11+
- INDENT
12+
- SYNTAX_CONSISTENT
13+
- QUOTE_CONSISTENT
14+
15+
# ordering
16+
- IMPORTS_SORTED
17+
18+
# naming
19+
- PACKAGE_NAME_LOWER_CASE
20+
- RPC_NAMES_UPPER_CAMEL_CASE
21+
- RPC_NAMES_CASE
22+
- SERVICE_NAMES_UPPER_CAMEL_CASE
23+
24+
rules_option:
25+
indent:
26+
style: tab
27+
not_insert_newline: true

api/services/control/control.pb.go

Lines changed: 135 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/control/control.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ syntax = "proto3";
22

33
package moby.buildkit.v1;
44

5-
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
6-
import "google/protobuf/timestamp.proto";
7-
import "github.com/moby/buildkit/solver/pb/ops.proto";
8-
import "github.com/moby/buildkit/api/types/worker.proto";
95
// import "github.com/containerd/containerd/api/types/descriptor.proto";
106
import "github.com/gogo/googleapis/google/rpc/status.proto";
7+
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
8+
import "github.com/moby/buildkit/api/types/worker.proto";
9+
import "github.com/moby/buildkit/solver/pb/ops.proto";
1110
import "github.com/moby/buildkit/sourcepolicy/pb/policy.proto";
11+
import "google/protobuf/timestamp.proto";
1212

1313
option (gogoproto.sizer_all) = true;
1414
option (gogoproto.marshaler_all) = true;

frontend/gateway/pb/gateway.pb.go

Lines changed: 148 additions & 149 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/gateway/pb/gateway.proto

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ syntax = "proto3";
22

33
package moby.buildkit.v1.frontend;
44

5-
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
65
import "github.com/gogo/googleapis/google/rpc/status.proto";
7-
import "github.com/moby/buildkit/solver/pb/ops.proto";
6+
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
87
import "github.com/moby/buildkit/api/types/worker.proto";
8+
import "github.com/moby/buildkit/solver/pb/ops.proto";
9+
import "github.com/moby/buildkit/sourcepolicy/pb/policy.proto";
910
import "github.com/moby/buildkit/util/apicaps/pb/caps.proto";
1011
import "github.com/tonistiigi/fsutil/types/stat.proto";
11-
import "github.com/moby/buildkit/sourcepolicy/pb/policy.proto";
12-
13-
1412

1513
option (gogoproto.sizer_all) = true;
1614
option (gogoproto.marshaler_all) = true;
@@ -70,7 +68,7 @@ message RefMap {
7068
}
7169

7270
message Attestations {
73-
repeated Attestation attestation = 1;
71+
repeated Attestation attestation = 1;
7472
}
7573

7674
message Attestation {
@@ -167,7 +165,7 @@ message SolveResponse {
167165
// deprecated
168166
string ref = 1; // can be used by readfile request
169167
// deprecated
170-
/* bytes ExporterAttr = 2;*/
168+
// bytes ExporterAttr = 2;
171169

172170
// these fields are returned when allowMapReturn was set
173171
Result result = 3;

session/auth/auth.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ package moby.filesync.v1;
55
option go_package = "auth";
66

77
service Auth{
8-
rpc Credentials(CredentialsRequest) returns (CredentialsResponse);
9-
rpc FetchToken(FetchTokenRequest) returns (FetchTokenResponse);
10-
rpc GetTokenAuthority(GetTokenAuthorityRequest) returns (GetTokenAuthorityResponse);
11-
rpc VerifyTokenAuthority(VerifyTokenAuthorityRequest) returns (VerifyTokenAuthorityResponse);
8+
rpc Credentials(CredentialsRequest) returns (CredentialsResponse);
9+
rpc FetchToken(FetchTokenRequest) returns (FetchTokenResponse);
10+
rpc GetTokenAuthority(GetTokenAuthorityRequest) returns (GetTokenAuthorityResponse);
11+
rpc VerifyTokenAuthority(VerifyTokenAuthorityRequest) returns (VerifyTokenAuthorityResponse);
1212
}
1313

1414
message CredentialsRequest {

session/filesync/filesync.proto

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ option go_package = "filesync";
77
import "github.com/tonistiigi/fsutil/types/wire.proto";
88

99
service FileSync{
10-
rpc DiffCopy(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
11-
rpc TarStream(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
10+
rpc DiffCopy(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
11+
rpc TarStream(stream fsutil.types.Packet) returns (stream fsutil.types.Packet);
1212
}
1313

1414
service FileSend{
15-
rpc DiffCopy(stream BytesMessage) returns (stream BytesMessage);
15+
rpc DiffCopy(stream BytesMessage) returns (stream BytesMessage);
1616
}
1717

18-
1918
// BytesMessage contains a chunk of byte data
2019
message BytesMessage{
2120
bytes data = 1;

session/secrets/secrets.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package moby.buildkit.secrets.v1;
55
option go_package = "secrets";
66

77
service Secrets{
8-
rpc GetSecret(GetSecretRequest) returns (GetSecretResponse);
8+
rpc GetSecret(GetSecretRequest) returns (GetSecretResponse);
99
}
1010

1111

solver/pb/ops.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,14 +393,14 @@ message MergeOp {
393393
}
394394

395395
message LowerDiffInput {
396-
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
396+
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
397397
}
398398

399399
message UpperDiffInput {
400-
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
400+
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
401401
}
402402

403403
message DiffOp {
404-
LowerDiffInput lower = 1;
405-
UpperDiffInput upper = 2;
404+
LowerDiffInput lower = 1;
405+
UpperDiffInput upper = 2;
406406
}

util/stack/stack.proto

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ syntax = "proto3";
33
package stack;
44

55
message Stack {
6-
repeated Frame frames = 1;
7-
repeated string cmdline = 2;
8-
int32 pid = 3;
9-
string version = 4;
10-
string revision = 5;
6+
repeated Frame frames = 1;
7+
repeated string cmdline = 2;
8+
int32 pid = 3;
9+
string version = 4;
10+
string revision = 5;
1111
}
1212

1313
message Frame {
14-
string Name = 1;
15-
string File = 2;
16-
int32 Line = 3;
14+
string Name = 1;
15+
string File = 2;
16+
int32 Line = 3;
1717
}

0 commit comments

Comments
 (0)