Login
objects rule
Login

The rule to check do object's types' declarations in the code contains or not some expressions. Checked things:

The syntax in a configuration file is:

[ruleType] ?not? objects [checkType]

Disabling the rule

It is possible to disable the rule for a selected part of the checked code by using pragma ruleOff: "objects" in the element from which the rule should be disabled or in code before it. For example, if the rule should be disabled for type myObject, the full declaration of it should be:

{.ruleOff: "objects".}
type myObject = object
  field: string

To enable the rule again, the pragma ruleOn: "objects" should be added in the element which should be checked or in code before it. For example, if the rule should be re-enabled for myRecord declaration, the full declaration should be:

{.ruleOn: "objects".}
type myRecord = object
  field: string

Examples

  1. Check if all objects' types' declarations contains public fields and standard types:

    check objects all

  2. Made all object's types' fields private::

    fix not objects publicfields