From a7aa4f219d05aeab4e63c8fb708b065699a35493 Mon Sep 17 00:00:00 2001 From: thindil Date: Sun, 17 Mar 2024 05:44:25 +0000 Subject: [PATCH] docs: added code documentation in ifstatements rule FossilOrigin-Name: eaf9ea2dcef647b099bfd946f49790fc4e02bbf03f307be7d090d879a936246f --- src/rules/ifstatements.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/rules/ifstatements.nim b/src/rules/ifstatements.nim index 4fca32d..c3c4f38 100644 --- a/src/rules/ifstatements.nim +++ b/src/rules/ifstatements.nim @@ -129,6 +129,12 @@ ruleConfig(ruleName = "ifstatements", {.push ruleOff: "paramsUsed".} proc checkMinMax(node, parent: PNode; messagePrefix: string; rule: var RuleOptions) {.raises: [ValueError], tags: [RootEffect], contractual.} = + ## Check the amount of branches of the selected if statement + ## + ## * node - the node which will be checked + ## * parent - the parent node of the node to check + ## * messagePrefix - the prefix added to the log message, set by the program + ## * rule - the rule options set by the user body: let astNode: PNode = parent var checkResult: bool = true @@ -150,6 +156,12 @@ proc checkMinMax(node, parent: PNode; messagePrefix: string; proc checkEmptyBranch(node, parent: PNode; messagePrefix: string; rule: var RuleOptions; checkResult: var bool) {.raises: [], tags: [RootEffect], contractual.} = + ## Check the if statement for empty branches + ## + ## * node - the node which will be checked + ## * parent - the parent node of the node to check + ## * messagePrefix - the prefix added to the log message, set by the program + ## * rule - the rule options set by the user body: let astNode: PNode = parent for child in node: