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

     1  ---
     2  rule:
     3    aip: 216
     4    name: [core, '0216', synonyms]
     5    summary: Lifecycle state enums should be called "State", not "Status".
     6  permalink: /216/synonyms
     7  redirect_from:
     8    - /0216/synonyms
     9  ---
    10  
    11  # States
    12  
    13  This rule enforces that all lifecycle state enums are called `State` rather
    14  than `Status`, as mandated in [AIP-216][].
    15  
    16  ## Details
    17  
    18  This rule iterates over enumerations and looks for enums with a name of
    19  `Status` or ending in `Status`, and suggests the use of `State` instead.
    20  
    21  ## Examples
    22  
    23  **Incorrect** code for this rule:
    24  
    25  ```proto
    26  // Incorrect.
    27  enum Status {  // Should be `State`.
    28    STATUS_UNSPECIFIED = 0;
    29  }
    30  ```
    31  
    32  ```proto
    33  // Incorrect.
    34  enum BookStatus {  // Should be `Book.State` or `BookState`.
    35    BOOK_STATUS_UNSPECIFIED = 0;
    36    HARDCOVER = 1;
    37  }
    38  ```
    39  
    40  **Correct** code for this rule:
    41  
    42  ```proto
    43  // Correct.
    44  enum State {
    45    STATE_UNSPECIFIED = 0;
    46  }
    47  ```
    48  
    49  ## Disabling
    50  
    51  If you need to violate this rule, use a leading comment above the enum value.
    52  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    53  
    54  ```proto
    55  // (-- api-linter: core::0216::synonyms=disabled
    56  //     aip.dev/not-precedent: We need to do this because reasons. --)
    57  enum Status {
    58    STATUS_UNSPECIFIED = 0;
    59  }
    60  ```
    61  
    62  If you need to violate this rule for an entire file, place the comment at the
    63  top of the file.
    64  
    65  [aip-216]: https://aip.dev/216
    66  [aip.dev/not-precedent]: https://aip.dev/not-precedent