Skip to content

Commit

Permalink
fix: adding code documentation with hasDoc rule
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 1dc867309571e17e96e5f3de12ef6952a5d3d545282275e3e351020f4d4236bb
  • Loading branch information
thindil committed Jun 2, 2024
1 parent 9a30ea9 commit f5ab916
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rules/hasdoc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f5ab916

Please sign in to comment.