From 3818e67bbf47816680896d2aec89feaab33b8d58 Mon Sep 17 00:00:00 2001 From: thindil Date: Sun, 2 Jun 2024 04:34:03 +0000 Subject: [PATCH] fix: crash on trying to fix a code documentation with hasDoc rule FossilOrigin-Name: 7432a49f298acc60ecec8f9b6cf677e30b41266e4aa988887233a9b75fc0046c --- src/rules/hasdoc.nim | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/rules/hasdoc.nim b/src/rules/hasdoc.nim index f10b27e..1665e4d 100644 --- a/src/rules/hasdoc.nim +++ b/src/rules/hasdoc.nim @@ -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