首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >clang-格式中断长doxygen注释

clang-格式中断长doxygen注释
EN

Stack Overflow用户
提问于 2019-03-24 04:30:50
回答 1查看 532关注 0票数 1

我在我的遗留代码库中得到了这个doxygen注释,为了保持一致性,我喜欢保留它们。

代码语言:javascript
复制
/***************//****************************************************************
 *
 * @file
 *
 * Serial inteface to Novatel OEM4 GPS API.
 *
 *******************************************************************************/

不幸的是,clang-format-7格式化注释是不寻常的,这使得doxygen注释变得无用。

代码语言:javascript
复制
/*****************************************************************************/ /**
                                                                                 *
                                                                                 * @file
                                                                                 *
                                                                                 * Serial inteface to Novatel OEM4 GPS API.
                                                                                                                                                                *
                                                                                 *******************************************************************************/

我在我的.clang格式中尝试了CommentPragmas:'^.+‘或'//**’,但没有成功。

我的.clang格式如下

代码语言:javascript
复制
---
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignEscapedNewlines: Right
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: 'false'
AlwaysBreakAfterDefinitionReturnType: None
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Stroustrup
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: BeforeComma
BreakStringLiterals: 'true'
ColumnLimit: '132'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
Cpp11BracedListStyle: 'true'
DerivePointerAlignment: 'false'
IndentCaseLabels: 'false'
IndentPPDirectives: AfterHash
IndentWidth: '4'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '1'
PointerAlignment: Right
ReflowComments: 'true'
SortIncludes: 'false'
SortUsingDeclarations: 'false'
SpaceAfterCStyleCast: 'true'
SpacesBeforeTrailingComments: '2'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'false'
SpaceBeforeParens: ControlStatements
Standard: Cpp11
TabWidth: '4'
UseTab: Never
CommentPragmas: '^\\.+'

...

我希望doxygen的注释在我的CommentPragmas上是不会被触及的,但它对我不起作用。

任何帮助都是非常感谢的。

EN

回答 1

Stack Overflow用户

发布于 2019-04-26 00:17:02

ReflowComments更改为false应该可以做到这一点(至少在clang-format 8.0中是这样)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55318084

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档