github.com/googleapis/api-linter@v1.65.2/docs/rules/0140/lower-snake.md (about) 1 --- 2 rule: 3 aip: 140 4 name: [core, '0140', lower-snake] 5 summary: Field names should use `snake_case`. 6 permalink: /140/lower-snake 7 redirect_from: 8 - /0140/lower-snake 9 --- 10 11 # Field names: Lower Snake Case 12 13 This rule enforces that field names use `snake_case`, as mandated in 14 [AIP-140][]. 15 16 ## Details 17 18 This rule checks every field in the proto and complains if the field name 19 contains a capital letter. 20 21 ## Examples 22 23 ### Single word method 24 25 **Incorrect** code for this rule: 26 27 ```proto 28 // Incorrect. 29 message Book { 30 string name = 1; 31 int32 pageCount = 2; // Should be `page_count`. 32 } 33 ``` 34 35 **Correct** code for this rule: 36 37 ```proto 38 // Correct. 39 message Book { 40 string name = 1; 41 int32 page_count = 2; 42 } 43 ``` 44 45 ## Disabling 46 47 If you need to violate this rule, use a leading comment above the method. 48 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 49 50 ```proto 51 // (-- api-linter: core::0140::lower-snake=disabled 52 // aip.dev/not-precedent: We need to do this because reasons. --) 53 message Book { 54 string name = 1; 55 string pageCount = 2; 56 } 57 ``` 58 59 If you need to violate this rule for an entire file, place the comment at the 60 top of the file. 61 62 [aip-140]: https://aip.dev/140 63 [aip.dev/not-precedent]: https://aip.dev/not-precedent