AEP-0143 Linter Rules
Standardized codes
Standardized codes
This rule attempts to enforce that standard codes for concepts like language, currency, etc. are consistently used rather than any alternatives, as mandated in AEP-143.
Details
This rule looks at any field with a name that looks close to a field with a common standardized code, but that is not exactly that. It complains if it finds one and suggests the correct field name.
It currently spots the following common substitutes:
content_type
country
currency
lang
language
mime
mimetype
tz
timezone
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.
Standardized code strings
Standardized code strings
This rule attempts to enforce that standard codes for concepts like language, currency, etc. are strings, as mandated in AEP-143.
Details
This rule looks at any field with a name matching a standardized code, and
complains if it has a type other than string
.
It currently matches the following field names:
currency_code
country_code
language_code
mime_type
time_zone
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.