Skip to content

Commit

Permalink
feat: better detection of standard types by objects rule
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 176bb53cf4e63117a13dfd92e84b23b877cba8b211b5dd6663ad73035c43fc72
  • Loading branch information
thindil committed Apr 11, 2024
1 parent af5dd5d commit 4294918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules/objects.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]])
Expand Down

0 comments on commit 4294918

Please sign in to comment.