Because protobuf recommends explicit presence for maximum compatibility with protobuf editions, we should enforce that all fields in our schema use explicit presence.
There are at least two good options to support this enforcement:
- Adding a new lint rule to the Buf CLI: We could make a feature request to Buf that they add a new lint rule enforcing explicit field presence, following their preferred process. They say they'll add rules if they "think they're maintainable and could have widespread value", and since explicit field presence is a documented recommendation directly from the protobuf team, it would be worth giving this approach a shot especially since it is less maintenance work for us in the long run.
- Creating a Buf check plugin: We could make a custom Buf check plugin following Buf's documentation which enforces explicit presence on all fields. This would probably we less that 50 lines of code, and we could use it in the future to enforce other Accrescent-specific protobuf rules. Since we don't yet have another need for a Buf check plugin, it would be better if we can get an explicit presence lint rule in the Buf CLI isntead, but if that's not possible, writing a Buf check plugin is an acceptable way to go.
See also accrescent/appstore-api#19.
Because protobuf recommends explicit presence for maximum compatibility with protobuf editions, we should enforce that all fields in our schema use explicit presence.
There are at least two good options to support this enforcement:
See also accrescent/appstore-api#19.