Skip to content

Commit e95e6de

Browse files
Rachel Goldfingercopybara-github
authored andcommitted
Update Style Guide to account for Edition 2026 naming style enforcement feature.
PiperOrigin-RevId: 914302479
1 parent 04a5488 commit e95e6de

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

content/programming-guides/style.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,28 @@ definition and field of that type instead of using the group syntax, using the
298298
feature for wire-compatibility.
299299

300300
See [groups](/programming-guides/proto2#groups).
301+
302+
### Avoid Field Names and Oneof Names that Could Potentially Cause Collisions {#collisions}
303+
304+
Using certain names together can cause collisions in generated code, which may
305+
prevent it from compiling. To reduce the risk of language-specific breakages,
306+
avoid certain prefixes, suffixes, and names.
307+
308+
#### Prefixes: {#avoid-prefixes}
309+
310+
* has_
311+
* get_
312+
* set_
313+
* clear_
314+
315+
#### Suffixes: {#avoid-suffixes}
316+
317+
* _value
318+
319+
#### Names: {#avoid-names}
320+
321+
* descriptor
322+
* Other language keywords and reserved words should be avoided; see
323+
[Avoid Using Language Keywords](/best-practices/dos-donts#avoid-keywords)
324+
and
325+
[Python keyword conflicts](/reference/python/python-generated#keyword-conflicts).

0 commit comments

Comments
 (0)