AEP-0192 Linter Rules
Absolute links
Absolute links
This rule attempts to enforce that every descriptor in every proto file uses absolute links, as mandated in AEP-192.
Details
This rule looks at each descriptor in each proto file (exempting oneofs and the
file itself) and tries to find Markdown links using the [link](uri)
syntax,
and complains if the URI does not have ://
in it.
Examples
Incorrect code for this rule:
Correct code for this rule:
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 aep.dev/not-precedent comment explaining why.
Deprecated comments
Deprecated comments
This rule enforces that every element marked with the protobuf deprecated
option has "Deprecated: <reason>"
as the first line in the public leading
comment, as mandated in AEP-192.
Details
This rule looks at each descriptor in each proto file, and complains if the
protobuf deprecated
option is set to true
, but the first line of the public
comment does not begin with “Deprecated: “.
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the descriptor. Remember to also include an aep.dev/not-precedent comment explaining why.
Omnipresent comments
Omnipresent comments
This rule enforces that every descriptor in every proto file has a public leading comment, as mandated in AEP-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:
Correct code for this rule:
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 aep.dev/not-precedent comment explaining why.
No HTML in comments
No HTML in comments
This rule enforces that every descriptor in every proto file does not use raw HTML in comments, as mandated in AEP-192.
Details
This rule looks at each descriptor in each proto file (exempting oneofs and the file itself) and tries to find HTML tags, and complains if it finds any.
Note: This lint rule uses a regular expression to look for HTML, which is a famous anti-pattern. We do it anyway to avoid taking a large dependency for one rule. Therefore, this rule allows many false negatives to avoid any false positives; that is, it will intentionally let more complex HTML through in order to prevent cases where it complains and is wrong.
Examples
Incorrect code for this rule:
Correct code for this rule:
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 aep.dev/not-precedent comment explaining why.
No Markdown headings
No Markdown headings
This rule enforces that public comments for proto descriptors do not have
Markdown headings (#
, ##
, etc.), as mandated in AEP-192.
Details
This rule looks at each descriptor in each proto file (exempting oneofs and the
file itself) and complains if public comments include Markdown headings (that
become <h1>
, <h2>
, etc.).
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the descriptor. Remember to also include an aep.dev/not-precedent comment explaining why.
No Markdown tables
No Markdown tables
This rule enforces that public comments for proto descriptors do not have Markdown tables, as mandated in AEP-192.
Details
This rule looks at each descriptor in each proto file (exempting oneofs and the file itself) and complains if public comments include Markdown tables.
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the descriptor. Remember to also include an aep.dev/not-precedent comment explaining why.
Only leading comments
Only leading comments
This rule enforces that every descriptor in every proto file has a public comment information only in leading comment (not trailing comments or detached comments), as mandated in AEP-192.
Details
This rule looks at each descriptor in each proto file (exempting oneofs and the file itself) and complains if public comments are either trailing or detached. Internal comments are not considered.
Examples
Incorrect code for this rule:
Correct code for this rule:
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 aep.dev/not-precedent comment explaining why.