github.com/googleapis/api-linter@v1.65.2/docs/rules/0126/upper-snake-values.md (about) 1 --- 2 rule: 3 aip: 126 4 name: [core, '0126', upper-snake-values] 5 summary: All enum values must be in upper snake case. 6 permalink: /126/upper-snake-values 7 redirect_from: 8 - /0126/upper-snake-values 9 --- 10 11 # Upper snake case values 12 13 This rule enforces that all enum values be in upper snake case, as mandated in 14 [AIP-126][]. 15 16 ## Details 17 18 This rule finds all enumerations and ensures that each value is provided in 19 `UPPER_SNAKE_CASE`. 20 21 ## Examples 22 23 **Incorrect** code for this rule: 24 25 ```proto 26 // Incorrect. 27 enum Format { 28 FORMAT_UNSPECIFIED = 0; 29 hardcover = 1; // Should be "HARDCOVER". 30 } 31 ``` 32 33 **Correct** code for this rule: 34 35 ```proto 36 // Correct. 37 enum Format { 38 FORMAT_UNSPECIFIED = 0; 39 HARDCOVER = 1; 40 } 41 ``` 42 43 ## Disabling 44 45 If you need to violate this rule, use a leading comment above the enum value. 46 47 ```proto 48 enum Format { 49 FORMAT_UNSPECIFIED = 0; 50 51 // (-- api-linter: core::0126::upper-snake-values=disabled --) 52 hardcover = 1; 53 } 54 ``` 55 56 If you need to violate this rule for an entire file, place the comment at the 57 top of the file. 58 59 [aip-126]: https://aip.dev/126