AEP-0142 Linter Rules
Timestamp field names
Timestamp field names
This rule enforces that timestamps are named using the imperative mood and with
a _time
suffix, as mandated in AEP-142.
Details
This rule looks at each google.protobuf.Timestamp
field and ensures that it
has a _time
suffix. If it is a repeated field, the _times
suffix is also
allowed.
It also looks for common field names, regardless of type, and complains if they are used. These are:
- created
- creation
- expired
- modified
- updated
- purged
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 method. Remember to also include an aep.dev/not-precedent comment explaining why.
If you need to violate this rule for an entire file, place the comment at the top of the file.
Timestamp field type
Timestamp field type
This rule enforces that timestamps are represented with
google.protobuf.Timestamp
, as mandated in AEP-142.
Details
This rule looks at each field and looks for common suffixes that indicate that
the field may represent time, and indicates that the
google.protobuf.Timestamp
type should be used instead.
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 method. Remember to also include an aep.dev/not-precedent comment explaining why.
If you need to violate this rule for an entire file, place the comment at the top of the file.