Skip to content

serial: add JSDoc documentation for module functions and constants - #468

Merged
jow- merged 2 commits into
masterfrom
feat/lib-serial-docs
Oct 5, 2026
Merged

jow- merged 2 commits into
masterfrom
feat/lib-serial-docs

Conversation

@jow-

@jow- jow- commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Add the missing JSDoc documentation to the serial module, following
the pattern established by the other lib modules:

  • module header describing the module and its import options
  • function documentation for all 21 exported functions, including
    parameter types and the null-on-error return contract
  • constant documentation for all 139 exported constants, grouped
    into apply modes, flush queues, termios flag sets, control
    character indices, baud rates, modem control line bits and the
    Linux-specific serial_struct flags and port types

Also add the conventional copyright header, which turns out to be
required for the jsdoc c-transpiler to recognize the module doc
comment: the transpiler only preserves /** blocks preceded by a
newline, so a doc comment at the very top of the file is mangled
into line comments and silently dropped from the generated docs.

Signed-off-by: Jo-Philipp Wich jo@mein.io

jow- added 2 commits October 5, 2026 23:09
The isCommentStart() helper requires a newline character before the
/** sequence, which can never be satisfied for a module doc comment
placed at the very top of a C source file. Such a comment is then
treated as code and mangled into line comments by the source rewrite,
silently dropping it from the generated documentation.

Treat offset zero as a valid comment boundary, and skip the empty
code chunk that results, whose line-comment rewrite would otherwise
prepend a stray // sequence to the preserved doc comment.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Add the missing JSDoc documentation to the serial module, following
the pattern established by the other lib modules:

- module header describing the module and its import options
- function documentation for all 21 exported functions, including
  parameter types and the null-on-error return contract
- constant documentation for all 139 exported constants, grouped
  into apply modes, flush queues, termios flag sets, control
  character indices, baud rates, modem control line bits and the
  Linux-specific serial_struct flags and port types

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
@jow-
jow- force-pushed the feat/lib-serial-docs branch from fa6b6d8 to 04d3ae5 Compare October 5, 2026 21:10
@jow-
jow- merged commit 117fee2 into master Oct 5, 2026
3 of 4 checks passed
@jow-
jow- deleted the feat/lib-serial-docs branch October 5, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant