Login
hasDoc rule
Login

The rule to check if all public declarations (variables, procedures, etc.) have documentation comments The syntax in a configuration file is::

[ruleType] ?not? hasDoc [entityType] [templateFile]

Disabling the rule

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

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

To enable the rule again, the pragma ruleOn: "hasDoc" should be added in the element which should be checked. For example, if the rule should be re-enabled for const a = 1, the full declaration should be:

const a = 1 {.ruleOn: "hasDoc".}

Examples

  1. Check if all public declarations in module have documentation:

    check hasDoc all

  2. Search for all modules which don't have documentation:

    search not hasDoc modules