microsoft / wil

Windows Implementation Library
MIT License
2.57k stars 234 forks source link

Prep for clang-format & add Doxygen target #409

Closed dunhor closed 9 months ago

dunhor commented 9 months ago

While adding a .clang-format file to WIL, I noticed a couple issues that needed to be sorted out manually:

For the first two, I've added several //clang-format off and //clang-format on comment pairs where necessary.

For the last, I've converted everything to @command syntax and I've manually wrapped lines that contain Doxygen style comments (begins with ///, //!, /**, or /*!). Note that I've wrapped at either 130 columns or 134 columns since the .clang-format file will wrap at 130 lines, but it will also reduce namespace indentation by one tab's worth.

I wanted to address these things separately because it's a lot easier to re-sync to master & re-run clang-format if I want to test something out (or sync new changes).

In order to validate the changes to the Doxygen comments, I've added a CMake target for generating the documentation (that's enabled only if you have Doxygen available in your PATH). E.g. run ninja docs to generate them.

I've also tried to fix up any issues I've seen with the Doxygen comments that I've seen. A few things to comment on:

The only remaining Doxygen warnings that aren't "thing is not documented" are:

G:/wil/include/wil/result_macros.h:2616: warning: unable to resolve reference to 'wil::g_fResultThrowPlatformException' for \ref command
G:/wil/include/wil/registry.h:2908: warning: argument 'key' from the argument list of wil::reg::get_value_expanded_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2908: warning: argument 'subkey' from the argument list of wil::reg::get_value_expanded_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2908: warning: argument 'value_name' from the argument list of wil::reg::get_value_expanded_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2908: warning: argument 'return_value' from the argument list of wil::reg::get_value_expanded_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2925: warning: argument 'key' from the argument list of wil::reg::get_value_expanded_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2925: warning: argument 'value_name' from the argument list of wil::reg::get_value_expanded_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2925: warning: argument 'return_value' from the argument list of wil::reg::get_value_expanded_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2603: warning: argument 'key' from the argument list of wil::reg::get_value_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2603: warning: argument 'subkey' from the argument list of wil::reg::get_value_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2603: warning: argument 'value_name' from the argument list of wil::reg::get_value_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2603: warning: argument 'return_value' from the argument list of wil::reg::get_value_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2620: warning: argument 'key' from the argument list of wil::reg::get_value_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2620: warning: argument 'value_name' from the argument list of wil::reg::get_value_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2620: warning: argument 'return_value' from the argument list of wil::reg::get_value_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2633: warning: argument 'key' from the argument list of wil::reg::get_value_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2633: warning: argument 'subkey' from the argument list of wil::reg::get_value_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2633: warning: argument 'value_name' from the argument list of wil::reg::get_value_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2633: warning: argument 'return_value' from the argument list of wil::reg::get_value_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2648: warning: argument 'key' from the argument list of wil::reg::get_value_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2648: warning: argument 'value_name' from the argument list of wil::reg::get_value_string_nothrow has multiple @param documentation sections
G:/wil/include/wil/registry.h:2648: warning: argument 'return_value' from the argument list of wil::reg::get_value_string_nothrow has multiple @param documentation sections