Only one variable per declaration rules

This variable declaration rule checks that no more than one variable has been declared per declaration.

The ruleId

The ruleId is oneVariablePerDefine

Options

The options available for the do not declare more than one variable per 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 declaration, and to output an warning if an exception is found, specify these rules:
oneVariablePerDefine.enabled = true
oneVariablePerDefine.severity = warning
In this example, this declaration would be compliant:
DEFINE a INTEGER
DEFINE b INTEGER
In this example, this declaration would NOT be compliant:
DEFINE a INTEGER, b INTEGER