转发文章强制clang格式尊重doxygen块注释

在C / C ++代码中使用长块C风格的Doxygen注释

/**************************************************************************//**
* \file
* \date   2017-01-02
* \author Alex Hogen
******************************************************************************/

如果对此运行clang-format,它将在两个正斜杠之间插入一个空格:

/**************************************************************************/ /**
* \file
* \date   2017-01-02
* \author Alex Hogen
******************************************************************************/

尝试CommentPragmas正则表达式\/\*+\/\/\*+ 尝试过CommentPragmas正则表达式/\*(.+\n.+)+\*/

我尝试将ReflowComments设置为false, 将SpacesBeforeTrailingComments设置为2, 这些都不起作用。

最后在.clang-format`文件中:

CommentPragmas:  '^\\.+'

Ref:

Search

    Table of Contents