From 429491887d556d06d1a08a03d879c2e01531f607 Mon Sep 17 00:00:00 2001 From: thindil Date: Thu, 11 Apr 2024 06:29:39 +0000 Subject: [PATCH] feat: better detection of standard types by objects rule FossilOrigin-Name: 176bb53cf4e63117a13dfd92e84b23b877cba8b211b5dd6663ad73035c43fc72 --- src/rules/objects.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rules/objects.nim b/src/rules/objects.nim index 11b61db..4b68b8a 100644 --- a/src/rules/objects.nim +++ b/src/rules/objects.nim @@ -128,7 +128,7 @@ checkRule: # To show the rule's explaination the rule.amount must be negative if rule.negation and oldAmount > rule.amount and rule.ruleType == check: rule.amount = -1_000 - if not checkResult: + if not checkResult and rule.options[0].toLowerAscii == "publicfields": break if rule.options[0].toLowerAscii in ["standardtypes", "all"] and node.kind == nkObjectTy: checkResult = false @@ -146,7 +146,7 @@ checkRule: checkResult = not checkResult let oldAmount: int = rule.amount try: - let message: string = (if rule.negation: "doesn't contain" else: "contains") & " field of int or string type." + let message: string = (if rule.negation: "contains" else: "doesn't contain") & " field of int or string type." setResult(checkResult = checkResult, positiveMessage = positiveMessage, negativeMessage = negativeMessage, ruleData = "standard types", node = node, params = [$node.info.line, message, $astNode[0]])