doc: fix style inconsistencies in code examples
Checklist
-
documentation is changed or added -
the commit message follows commit guidelines
Affected core subsystem(s)
doc
Description of change
Added missing semicolons, braces, and fixed indentation.