Only one variable per type inside a single declaration rules

This variable declaration rule checks that no more than one variable has been declared per type inside a single declaration.

The ruleId

The ruleId is typeDeclarationPerVariable.

Options

The options available for the no more than one variable has been declared per type inside a single declaration rules are:
  • .enabled specifies whether a rule is enabled. Valid values are true or false.
  • .severity specifies the severity level. Valid values are error, info, or warning (default).
    Warning: If the severity is set to error, the compilation will fail if the rule is broken.

Example

To ensure that only one variable has been declared per type inside a single declaration, and to output an warning if an exception is found, specify these rules:
typeDeclarationPerVariable.enabled = true
typeDeclarationPerVariable.severity = warning
In this example, this declaration would be compliant:
DEFINE a INTEGER, b INTEGER
In this example, this declaration would NOT be compliant:
DEFINE a, b INTEGER