engine
engine copied to clipboard
Lint proto files
I just discovered a nice tool (buf) on top of protobuf and one of the features is to have a linter.
There are quite a lot of issues on the proto definition that could be fixed, but will probably break the API but fortunately, this tool also has a breaking change detector.
This would resolve any long discussion about naming, file location, package name etc...
Few lines from the linter
buf check lint
gogo/protobuf/gogoproto/gogo.proto:30:1:Files with package "gogoproto" must be within a directory "gogoproto" relative to root but were in directory "gogo/protobuf/gogoproto".
gogo/protobuf/gogoproto/gogo.proto:30:1:Package name "gogoproto" should be suffixed with a correctly formed version, such as "gogoproto.v1".
protobuf/api/account.proto:6:1:Files with package "mesg.api" must be within a directory "mesg/api" relative to root but were in directory "protobuf/api".
protobuf/api/account.proto:6:1:Package name "mesg.api" should be suffixed with a correctly formed version, such as "mesg.api.v1".
protobuf/api/account.proto:14:9:Service name "Account" should be suffixed with "Service".
protobuf/api/account.proto:17:12:RPC request type "GetAccountRequest" should be named "GetRequest" or "AccountGetRequest".
protobuf/api/account.proto:17:40:RPC response type "Account" should be named "GetResponse" or "AccountGetResponse".
protobuf/api/account.proto:20:13:RPC request type "ListAccountRequest" should be named "ListRequest" or "AccountListRequest".
protobuf/api/account.proto:20:42:RPC response type "ListAccountResponse" should be named "ListResponse" or "AccountListResponse".
check the draft done here: https://github.com/mesg-foundation/engine/pull/1409