Repository navigation
rulec v0.22.0
Rules that passed and now fail
| Code | What it stops |
|---|---|
| E002 | An alias in parentheses that is not a name. 六十(60) passed with the parentheses dropped, so the value had no alias at all. |
| E032 | A rule that imports an enum from a .proto whose name has a run of capitals (HTTPMethod) or whose values leave a digit after the prefix (SIZE_60), with the aliases the old reading asked for — the zero value http_method_unspecified among them. The prefix is now split the way buf splits it (HTTP_METHOD_), and SIZE_60 is size_60. A contract that passes buf lint no longer fails E032 for its names. |
Fixed
- The Connect service of a rule with an enum imported from a
.protodid not start as generated: it imported the contract's stubs as a top-level module, found only withstubs/added toPYTHONPATH. It imports them fromstubs/now. rulec testfailed the Connect passes of such a rule, andbuf generatein the generatedproto/stopped at the import: the contract was not in the module. See Changed.rulec apiandrulec doc --format htmllooked for the files a rule cites from the working directory instead of the rule's own.apinamed an imported enum without its package, and the approver's page read inputs out of a.protocontract in a way protojson does not write them.- A rule's own enum whose alias has a run of capitals (
HTTPRoute) was written to the.protoasH_T_T_P_ROUTE_…, whichbuf lintrefuses and on which the service failed to start. It isHTTP_ROUTE_…. - The service's description said
--httpneeds nothing installed. The server is the standard library's;connectrpcand the stubs are still needed.
Added
rulec api'sconnectentry describes the wire for a caller that writes the JSON by hand:enums, with each value's name on the wire and its number, the name of value 0 when it means "not set", and the contract an imported enum comes from;optionalandenumon every field; andelement_fieldsfor a rule that walks a sequence.
Changed
- The generated Connect service refuses a request that leaves an input out (
invalid_argument,会員: not set). Every field of the request is nowoptionalin the.proto. proto3 read a field left out as its zero, so a request that named nothing was decided as 0,falseand the first value — and, where a contract puts a real value at 0, as that value. A caller that leavesfalseor0out of its JSON is now refused, andbuf breakingreports the change. - It refuses a field or an enum value the request message does not have (
invalid_argument). Connect's JSON reader drops them by default, so a misspelt input was decided as zero. gencopies the contract animport protoenum comes from into the generated module, byte for byte, at the path its package gives it (proto/shop/v1/order.proto), and the generated.protoimports it from there. A file the contract imports comes with it when it is found beside it; one from a BSR module, such as protovalidate's, does not, and buf names it. Two different contracts that would land on one path stopgen.
One static binary per platform, no runtime; on Linux also as a .deb and an .rpm. Verify a download against SHA256SUMS before running it; the install page says how.