github.com/googleapis/api-linter@v1.65.2/docs/rules/0191/proto-version.md (about) 1 --- 2 rule: 3 aip: 191 4 name: [core, '0191', proto-version] 5 summary: All proto files must use proto3. 6 permalink: /191/proto-version 7 redirect_from: 8 - /0191/proto-version 9 --- 10 11 # Proto3 syntax 12 13 This rule enforces that every proto file for a public API surface uses proto3, 14 as mandated in [AIP-191][]. 15 16 ## Details 17 18 This rule looks at each proto file, and complains if the syntax is set to 19 `proto2` (or missing, which means it defaults to `proto2`). 20 21 ## Examples 22 23 **Incorrect** code for this rule: 24 25 ```proto 26 // Incorrect. 27 syntax = "proto2"; // Should be proto3. 28 ``` 29 30 **Correct** code for this rule: 31 32 ```proto 33 // Correct. 34 syntax = "proto3"; 35 ``` 36 37 ## Disabling 38 39 If you need to violate this rule, use a comment at the top of the file. 40 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 41 42 ```proto 43 // (-- api-linter: core::0191::proto-version=disabled 44 // aip.dev/not-precedent: We need to do this because reasons. --) 45 syntax = "proto2"; 46 ``` 47 48 [aip-191]: https://aip.dev/191 49 [aip.dev/not-precedent]: https://aip.dev/not-precedent