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

Documentation


object-should-have-a-description

Description

  • Custom objects should have a description, describing how the object is used.

Metadata Types

  • Custom Object

Implementation

  • Identifies metadata files that end with .object-meta.xml and have a __c or __e in the filename.
  • Checks for a <description> tag in the file.

Source: src/rules/object-should-have-a-description.ts


object-description-minimum-length

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/object-description-minimum-length.ts

Options

Name Description Type Example
minimumLength (optional, defaults to 50) The minimum length that the custom object description should meet. integer 30

field-should-have-a-description

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/field-description-minimum-length.ts

Options

Name Description Type Example
minimumLength (optional, defaults to 50) The minimum length that the custom field description should meet. integer 30

field-description-minimum-length

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/field-description-minimum-length.ts

Options

Name Description Type Example
minimumLength (optional, defaults to 50) The minimum length that the custom field description should meet. integer 30

flow-should-have-a-description

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/flow-should-have-a-description.ts


flow-description-minimum-length

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/flow-description-minimum-length.ts

Options

Name Description Type Example
minimumLength (optional, defaults to 50) The minimum length that the Flow description should meet. integer 30

validation-rule-description-minimum-length

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/validation-rule-description-minimum-length.ts

Options

Name Description Type Example
minimumLength (optional, defaults to 50) The minimum length that the Validation Rule description should meet. integer 30

validation-rule-error-minimum-length

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/validation-rule-error-minimum-length.ts

Options

Name Description Type Example
minimumLength (optional, defaults to 50) The minimum length that the Validation Rule error message should meet. integer 30

metadata-should-have-prefix

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/metadata-should-have-prefix.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__

metadata-should-not-have-prefix

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/metadata-should-not-have-prefix.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__

picklist-values-should-not-contain-double-spaces

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/picklist-values-should-not-contain-double-spaces.ts


value-set-should-not-contain-double-spaces

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/value-set-should-not-contain-double-spaces.ts