Skip to content

Docs: add coding conventions doc and improve Doxygen infrastructure#254

Merged
caitlinross merged 2 commits into
codes-org:masterfrom
caitlinross:docs
Jul 1, 2026
Merged

Docs: add coding conventions doc and improve Doxygen infrastructure#254
caitlinross merged 2 commits into
codes-org:masterfrom
caitlinross:docs

Conversation

@caitlinross

Copy link
Copy Markdown
Member

Stands up two developer-doc deliverables, in separate commits:

  • Coding conventions doc (doc/dev/conventions.md): one place for the rules that clang-format can't enforce: snake_case naming, .cxx/.c/.h extensions, CODES_/SRC_..._H header guards (not #pragma once), etc.
  • Doxygen API-doc infrastructure: replaces the stale, un-wired doc/Doxyfile (which dumped HTML into the source tree) with a CMake-wired, on-demand docs target via doxygen_add_docs(). Opt-in behind -DCODES_BUILD_DOXYGEN=ON (OFF by default). Output goes to the build tree. As I work on refactoring, I will improve doxygen comments on things I touch so the docs will improve over time. Code reviewers should also ensure that any PRs they review have appropriate documentation added.

Right now the docs are just available locally, but in the future I plan to make them available online, perhaps on read the docs.
To build locally:

cmake -S . -B build -DCODES_BUILD_DOXYGEN=ON
cmake --build build --target docs

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Capture the naming/extension/header-guard/LP-state decisions from recent
refactoring work in an enforceable, discoverable doc/dev/conventions.md,
and link it from the README Contributing section.

Formatting rules are left to .clang-format as the
machine-checkable source of truth.
Replace the stale, un-wired doc/Doxyfile (committed in a85b983; EXTRACT_ALL=YES
and OUTPUT_DIRECTORY=doc, which would dump HTML into the source tree) with a
CMake-wired, on-demand docs build:

- doc/CMakeLists.txt uses the modern doxygen_add_docs() (CMake >=3.9) instead of
  copying ROSS's older configure_file + add_custom_command form. Output goes to
  the build tree (${CMAKE_BINARY_DIR}/doc); INPUT is codes/ + src/ with the
  README as the mainpage.
- EXTRACT_ALL=NO + WARN_IF_UNDOCUMENTED=NO are the key settings: the output
  contains only entities that carry a /** */ comment, so it starts near-empty
  and fills in as docs are added (YAML config first) with no warning spam about
  the undocumented legacy tree.
- option(CODES_BUILD_DOXYGEN ... OFF); add_subdirectory(doc) only when ON, so the
  common build is unaffected and `docs` is never part of `all`. No CI gate.
- conventions.md gains a Documentation-comments subsection: doc-as-you-go / no
  mass backfill, how to build the docs, output lives in the gitignored build
  tree, and the @file-block requirement for free C functions to render.
@caitlinross caitlinross merged commit eb7bbea into codes-org:master Jul 1, 2026
14 checks passed
@caitlinross caitlinross deleted the docs branch July 1, 2026 18:41
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