Login
ranges rule
Login

The rule to check do ranges' declarations in the code follow some design patterns. Checked things:

The syntax in a configuration file is:

[ruleType] ?not? ranges [checkType]

Disabling the rule

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

proc main() {.ruleOff: "ranges".}

To enable the rule again, the pragma ruleOn: "ranges" 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 procedure proc main(), the full declaration should be::

proc main() {.ruleOn: "ranges".}

Examples

  1. Check if all ranges' declarations in the code have spaces before and after .. sign, the opposite to the Nim coding standard:

    check ranges spaces

  2. Replace all range's declarations in the code with the Nim coding standard:

    fix not ranges spaces