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.

MetadataTypes

  • 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.

MetadataTypes

  • 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.

MetadataTypes

  • 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.

MetadataTypes

  • 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.

MetadataTypes

  • 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.

MetadataTypes

  • 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.

MetadataTypes

  • 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.

MetadataTypes

  • 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}

MetadataTypes

  • 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__