Skip to content

Commit

Permalink
fix: crash on trying to fix a code documentation with hasDoc rule
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 7432a49f298acc60ecec8f9b6cf677e30b41266e4aa988887233a9b75fc0046c
  • Loading branch information
thindil committed Jun 2, 2024
1 parent 08cc6d9 commit 3818e67
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/rules/hasdoc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,6 @@ fixRule:
return false
if astNode.kind == nkObjectTy:
astNode[2].comment = docTemplate
elif astNode.kind notin {nkEnumTy, nkIdentDefs, nkConstDef}:
let docNode: PNode = newNode(kind = nkCommentStmt)
docNode.comment = docTemplate
astNode.sons = docNode & astNode.sons
else:
astNode.comment = docTemplate
return true

0 comments on commit 3818e67

Please sign in to comment.