Skip to content

Commit

Permalink
fix: search check type for ifstatements rule
Browse files Browse the repository at this point in the history
FossilOrigin-Name: fdc35727af6913c63d55741a11e9019266d2f5164d8d01b701997f256dd1fb5b
  • Loading branch information
thindil committed Mar 15, 2024
1 parent 6b1d540 commit e4a70e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules/ifstatements.nim
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ checkRule:
checkResult = node[^1].kind notin {nkElse, nkElseExpr}
if rule.ruleType == RuleTypes.count:
checkResult = not checkResult
elif rule.ruleType == RuleTypes.count:
elif rule.ruleType in {RuleTypes.count, search}:
checkResult = false
setResult(checkResult = checkResult,
positiveMessage = positiveMessage,
Expand Down Expand Up @@ -188,7 +188,7 @@ checkRule:
if child[^1].kind == nkStmtList and child[^1].len == 1:
checkResult = child[^1][0].kind != nkDiscardStmt or child[^1][0][
0].kind != nkEmpty
if rule.ruleType == RuleTypes.count and not rule.negation:
if rule.ruleType in {RuleTypes.count, search}:
checkResult = not checkResult
setResult(checkResult = checkResult,
positiveMessage = positiveMessage,
Expand Down

0 comments on commit e4a70e8

Please sign in to comment.