pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.59k stars 462 forks source link

Ignore inline protolint comments #466

Open rurounijones opened 2 years ago

rurounijones commented 2 years ago

Protolint allow for the usage of inline comments to disable some linting rules. The format of these rules is described in the above link and some examples are below:

enum Foo {
  // protolint:disable:next ENUM_FIELD_NAMES_UPPER_SNAKE_CASE
  firstValue = 0;
  second_value = 1;  // protolint:disable:this ENUM_FIELD_NAMES_UPPER_SNAKE_CASE
  THIRD_VALUE = 2; 
}

It would be amazing if protoc-gen-doc could avoid outpitting documentation for lines that start with // protolint: to the generated documentation. Currently the following lines

enum Coalition {
  // protolint:disable:next ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH
  COALITION_ALL = 0;
  COALITION_NEUTRAL = 1;
  COALITION_RED = 2;
  COALITION_BLUE = 3;
}

will output the following documentation for example:

image