-
Notifications
You must be signed in to change notification settings - Fork 0
Rules
- no-missing-description-on-objects
- description-min-length-on-objects
- no-missing-description-on-fields
- description-min-length-on-fields
- no-missing-description-on-flows
- description-min-length-on-flows
- description-min-length-on-validation-rules
- error-message-min-length-on-validation-rules
- no-missing-prefix-on-metadata
- no-prefix-on-metadata
- no-double-spaces-in-picklist-fields
- no-double-spaces-in-value-sets
Checks that the "Description" field is populated on custom objects.
Short Description
Custom objects should have a description.
Full Description
Custom objects should have a description defining the purpose of the object. Populate the 'Description' field on the custom object.
Metdata Types
- Custom Object
Example of incorrect metadata for this rule
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<deploymentStatus>Deployed</deploymentStatus>
<label>Car</label>
<nameField>
<encryptionScheme>None</encryptionScheme>
<label>Car Name</label>
<trackHistory>true</trackHistory>
<type>Text</type>
</nameField>
<pluralLabel>Cars</pluralLabel>
</CustomObject>
Example of correct metadata for this rule
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<deploymentStatus>Deployed</deploymentStatus>
<description>Car</description>
<label>Car</label>
<nameField>
<encryptionScheme>None</encryptionScheme>
<label>Car Name</label>
<trackHistory>true</trackHistory>
<type>Text</type>
</nameField>
<pluralLabel>Cars</pluralLabel>
</CustomObject>
Source: src/rules/no-missing-description-on-objects.ts
Description
- A custom object should have a description, describing how the object is used. The description should be at least
{option.minimumLength}
characters long.
Metadata Types
- Custom Object
Implementation
- Identifies metadata files that end with
.object-meta.xml
and have a__c
or__e
in the filename. - Checks the length of the value in the
<description>
tag in the file against the{option.minimumLength}
Source: src/rules/description-min-length-on-objects.ts
Options
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the custom object description should meet. | integer | 30 |
Description
- Custom fields should have a description, describing how the field is used.
Metadata Types
- Custom Field
Implementation
- Identifies metadata files that end with
.field-meta.xml
and have a__c
or__e
in the filename. - Checks the length of the value in the
<description>
tag in the file against the{option.minimumLength}
Source: src/rules/description-min-length-on-fields.ts
Options
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the custom field description should meet. | integer | 30 |
Description
- A custom field should have a description, describing how the field is used. The description should be at least
{option.minimumLength}
characters long.
Metadata Types
- Custom Field
Implementation
- Identifies metadata files that end with
.field-meta.xml
and have a__c
or__e
in the filename. - Checks the length of the value in the
<description>
tag in the file against the{option.minimumLength}
Source: src/rules/description-min-length-on-fields.ts
Options
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the custom field description should meet. | integer | 30 |
Description
- Flows should have a description, describing how the Flow is used.
Metadata Types
- Flow
Implementation
- Identifies metadata files that end with
.flow-meta.xml
. - Checks for a
<description>
tag in the file.
Source: src/rules/no-missing-description-on-flows.ts
Description
- A Flow should have a description, describing how the flow is used. The description should be at least
{option.minimumLength}
characters long.
Metadata Types
- Flow
Implementation
- Identifies metadata files that end with
.flow-meta.xml
- Checks the length of the value in the
<description>
tag in the file against the{option.minimumLength}
Source: src/rules/description-min-length-on-flows.ts
Options
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the Flow description should meet. | integer | 30 |
Description
- A Validation Rule should have a description, describing how the Validation Rule is used. The description should be at least
{option.minimumLength}
characters long.
Metadata Types
- Validation Rule
Implementation
- Identifies metadata files that end with
.validationRule-meta.xml
- Checks the length of the value in the
<description>
tag in the file against the{option.minimumLength}
Source: src/rules/description-min-length-on-validation-rules.ts
Options
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the Validation Rule description should meet. | integer | 30 |
Description
- A Validation Rule should have a description, describing how the Validation Rule is used. The description should be at least
{option.minimumLength}
characters long.
Metadata Types
- Validation Rule
Implementation
- Identifies metadata files that end with
.validationRule-meta.xml
- Checks the length of the value in the
<errorMessage>
tag in the file against the{option.minimumLength}
Source: src/rules/error-message-min-length-on-validation-rules.ts
Options
Name | Description | Type | Example |
---|---|---|---|
minimumLength |
(optional, defaults to 50) The minimum length that the Validation Rule error message should meet. | integer | 30 |
Description
All metata must have an API name prefix of one of the following: {option.prefixes}
or
Metadata of types: {option.types}
should have one of the following prefixes: {option.prefixes}
Metadata Types
- All custom metadata, or the types defined in
option.types
Implementation
- This rule can be used to enforce certain naming conventions, eg. prefixing metadata names with
ACME_
. - It identifies all custom metadata files, or metadata of the type definied in
options.types
. - Some objects are implicitly custom (eg. Validation Rule), but for metadata like Custom Fields, it checks for the presence of a
__c
or__e
etc to avoid running against standard fields. - For the identified metadata files, it checks that the filename starts with one of the prefixes defined in
options.prefixes
.
Source: src/rules/no-missing-prefix-on-metadata.ts
Options
Name | Description | Type | Example |
---|---|---|---|
prefixes |
(required) The prefixes you want the rule to check against | string (comma delimited) of prefixes | ACME_, EC_ |
types |
(optional) The types of metadata you want this rule to run against. If not specified, the rule will run against all custom metadata. | string (comma delimited) of metadata types, based on the file extension (case sensitive) - eg. For .flow-meta.xml use flow , for .validationRule-meta.xml use validationRule etc. |
field, fieldSet, listView |
exclude-namespaces |
(optional) The namespace of any custom metadata you wish to exclude from the rule | string (comma delimited) of namespaces | FinServ__, et4ae5__ |
Description
Metadata should not be prefixed with any of the following: {option.prefixes}
or
Metadata should not have a prefix of: {option.prefixes}
. This applies to metadata of types: {option.types}
Metadata Types
- All custom metadata, or the types defined in
option.types
Implementation
- This rule is useful for changing behaviour in teams where a prefix was previously adopted, or from excluding certain types of metadata in teams where a prefix is being used.
- It identifies all custom metadata files, or metadata of the type definied in
options.types
.< - Some objects are implicitly custom (eg. Validation Rule), but for metadata like Custom Fields, it checks for the presence of a
__c
or__e
etc to avoid running against standard fields. - For the identified metadata files, it checks that the filename does not start with one of the prefixes defined in
options.prefixes
.
Source: src/rules/no-prefix-on-metadata.ts
Options
Name | Description | Type | Example |
---|---|---|---|
prefixes |
(required) The prefixes you want the rule to check against | string (comma delimited) of prefixes | ACME_, EC_ |
types |
(optional) The types of metadata you want this rule to run against. If not specified, the rule will run against all custom metadata. | string (comma delimited) of metadata types, based on the file extension (case sensitive) - eg. For .flow-meta.xml use flow , for .validationRule-meta.xml use validationRule etc. |
field, fieldSet, listView |
exclude-namespaces |
(optional) The namespace of any custom metadata you wish to exclude from the rule | string (comma delimited) of namespaces | FinServ__, et4ae5__ |
Description
- Picklist labels and values should not contain double spaces eg.
Offer Made
.
Metadata Types
- Custom Field of type Picklist or MultiselectPicklist
Implementation
- Identifies metadata files that end with
.field-meta.xml
- Checks if they have a type of
Picklist
orMultiselectPicklist
- Checks all entries in the picklist (both label and value) for double spaces eg.
Source: src/rules/no-double-spaces-in-picklist-fields.ts
Description
- Value Set labels and values should not contain double spaces eg.
Offer Made
.
Metadata Types
- StandardValueSet
- GlobalValueSet
Implementation
- Identifies metadata files that end with
.standardValueSet-meta.xml
orglobalValueSet-meta.xml
- Checks all entries in the picklist (both label and value) for double spaces eg.
Source: src/rules/no-double-spaces-in-value-sets.ts
- no-missing-description-on-objects
- no-missing-description-on-fields
- no-missing-description-on-flows
- no-missing-description-on-validation-rules
- description-min-length-on-objects
- description-min-length-on-fields
- description-min-length-on-flows
- description-min-length-on-validation-rules
- error-message-min-length-on-validation-rules
- no-missing-prefix-on-metadata
- no-prefix-on-metadata
- no-double-spaces-in-picklist-fields
- no-double-spaces-in-value-sets