diff --git a/AGENTS.md b/AGENTS.md index 2a4b74a3f4c..ccb386f7ff5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -56,7 +56,7 @@ Other top-level areas: Follow these project docs instead of duplicating their contents: -- `docs/CodeStyle.md` for C/C++ formatting and naming. +- `docs/CodeStyle.md` for C/C++ formatting, naming, and comment style. - `docs/LoggingStyle.md` for log levels and message style. - `docs/OptimizationStyle.md` for performance-sensitive changes. - `REVIEW.md` for UCX pull-request review checks and comment style. diff --git a/docs/CodeStyle.md b/docs/CodeStyle.md index a7aa9ad1f21..e96bfa8edda 100644 --- a/docs/CodeStyle.md +++ b/docs/CodeStyle.md @@ -18,6 +18,16 @@ * Use `ucs_assert*` for internal invariants, not user-input validation. +## Comments + * Usually one line; use more only for a non-obvious or complex point, or + per the `## Doxygen` section below. + * Focus on "why" rather than "what"; no PR/issue references, no dev-process + narration. + * Document once, in the most relevant area. + * Explain locking, ownership, tradeoffs, or step-by-step processing when + non-obvious. + + ## Naming convention: * Lower case, underscores * Names must begin with ucp_/uct_/ucs_/ucm_