github.com/googleapis/api-linter@v1.65.2/docs/rules/0140/underscores.md (about)

     1  ---
     2  rule:
     3    aip: 140
     4    name: [core, '0140', underscores]
     5    summary: Field names must not have goofy underscores.
     6  permalink: /140/underscores
     7  redirect_from:
     8    - /0140/underscores
     9  ---
    10  
    11  # Field names: Underscores
    12  
    13  This rule enforces that field names do not use leading, trailing, or adjacent
    14  underscores, as mandated in [AIP-140][].
    15  
    16  ## Details
    17  
    18  This rule checks every field in the proto and complains if it sees leading or
    19  trailing underscores, or two or more underscores with nothing in between them.
    20  
    21  ## Examples
    22  
    23  **Incorrect** code for this rule:
    24  
    25  ```proto
    26  // Incorrect.
    27  message Book {
    28    string name = 1;
    29    string _title = 2;  // Should be `title`.
    30  }
    31  ```
    32  
    33  **Correct** code for this rule:
    34  
    35  ```proto
    36  // Correct.
    37  message Book {
    38    string name = 1;
    39    string title = 2;
    40  }
    41  ```
    42  
    43  ## Disabling
    44  
    45  If you need to violate this rule, use a leading comment above the method.
    46  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    47  
    48  **Warning:** Violating this rule is likely to run into tooling failures.
    49  
    50  ```proto
    51  // (-- api-linter: core::0140::underscores=disabled
    52  //     aip.dev/not-precedent: We need to do this because reasons. --)
    53  message Book {
    54    string name = 1;
    55    string _title = 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