code review - chunhualiao/public-docs GitHub Wiki
Put results into comments
For Doxygen-style comments, there isn't a built-in tag specifically for code review comments, but you can use existing tags effectively to document them. Here are some commonly used options:
-
@note
– Use this to highlight review comments that provide additional information about the code./** * @note This function uses a naive approach and may need optimization. */
-
@warning
– If a review comment identifies a potential issue or risk./** * @warning This implementation is not thread-safe. */
-
@todo
– If the review suggests changes that should be addressed in the future./** * @todo Refactor this function to improve performance. */
-
@bug
– If the review identifies an actual defect./** * @bug Edge cases with negative numbers are not handled correctly. */
-
@deprecated
– If a function or feature is marked for replacement./** * @deprecated Use newFunction() instead. */
-
Custom Tags – Doxygen allows custom sectioning. You can define something like:
/** * @code_review Needs better error handling. */
However, custom tags might not be recognized by all tools unless explicitly configured.
For best practices, a combination of @todo
, @warning
, and @note
often works well.