Skip to content
Tom Carman edited this page Jun 27, 2024 · 55 revisions


no-missing-description-on-objects

Purpose

Checks that the "Description" field is populated on custom objects.

Rule Details

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

Examples

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>

Implementation

Source: src/rules/no-missing-description-on-objects.ts


description-min-length-on-objects

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

no-missing-description-on-fields

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-min-length-on-fields

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

no-missing-description-on-flows

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-min-length-on-flows

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-min-length-on-validation-rules

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

error-message-min-length-on-validation-rules

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

no-missing-prefix-on-metadata

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__

no-prefix-on-metadata

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__

no-double-spaces-in-picklist-fields

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 or MultiselectPicklist
  • Checks all entries in the picklist (both label and value) for double spaces eg.

Source: src/rules/no-double-spaces-in-picklist-fields.ts


no-double-spaces-in-value-sets

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 or globalValueSet-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