Omnipresent comments

This rule enforces that every descriptor in every proto file has a public leading comment, as mandated in AIP-192.

Details

This rule looks at each descriptor in each proto file (exempting oneofs and the file itself) and complains if no public comment is found above the descriptor.

Examples

Incorrect code for this rule:

// Incorrect.
// A representation of a book.
message Book {
  string name = 1;  // No leading comment.
}

Correct code for this rule:

// Correct.
// A representation of a book.
message Book {
  // The resource name of the book.
  string name = 1;
}

Disabling

If you need to violate this rule, use a leading comment above the descriptor (and revel in the irony). Remember to also include an aip.dev/not-precedent comment explaining why.

// A representation of a book.
message Book {
  // (-- api-linter: core::0192::has-comments=disabled
  //     aip.dev/not-precedent: We need to do this because reasons. --)
  string name = 1;
}