From f5ab91632e60fbf9420a3b461c5e266baa90d6e9 Mon Sep 17 00:00:00 2001 From: thindil Date: Sun, 2 Jun 2024 04:38:35 +0000 Subject: [PATCH] fix: adding code documentation with hasDoc rule FossilOrigin-Name: 1dc867309571e17e96e5f3de12ef6952a5d3d545282275e3e351020f4d4236bb --- src/rules/hasdoc.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rules/hasdoc.nim b/src/rules/hasdoc.nim index 1665e4d..73cbc1d 100644 --- a/src/rules/hasdoc.nim +++ b/src/rules/hasdoc.nim @@ -235,6 +235,10 @@ fixRule: return false if astNode.kind == nkObjectTy: astNode[2].comment = docTemplate + elif astNode.kind == nkStmtList: + let docNode: PNode = newNode(kind = nkCommentStmt) + docNode.comment = docTemplate + astNode.sons = docNode & astNode.sons else: astNode.comment = docTemplate return true