尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

CPP 格式化文件 .clang-format

CPP 格式化文件 .clang-format
📅 发布时间:2026/6/20 19:33:42
---
Language: Cpp
# BasedOnStyle:  ChromiumColumnLimit: 0            # 注释与代码不再受列数限制
ReflowComments: false     # 禁止自动重新排版注释MaxEmptyLinesToKeep: 1
SeparateDefinitionBlocks: Always   # 让函数/方法之间保持空行
EmptyLineBeforeAccessModifier: AlwaysAllowShortFunctionsOnASingleLine: Inline#(其余保持你的原样)
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:- __capability
BinPackArguments: true
BinPackParameters: false
BraceWrapping:AfterCaseLabel: falseAfterClass: trueAfterControlStatement: NeverAfterEnum: falseAfterFunction: trueAfterNamespace: trueAfterObjCDeclaration: falseAfterStruct: trueAfterUnion: falseAfterExternBlock: falseBeforeCatch: falseBeforeElse: falseBeforeLambdaBody: falseBeforeWhile: falseIndentBraces: falseSplitEmptyFunction: trueSplitEmptyRecord: trueSplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
CommentPragmas: "^ IWYU pragma:"
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:- foreach- Q_FOREACH- BOOST_FOREACH
StatementAttributeLikeMacros:- Q_EMIT
IncludeBlocks: Preserve
IncludeCategories:- Regex: '^<ext/.*\.h>'Priority: 2SortPriority: 0CaseSensitive: false- Regex: '^<.*\.h>'Priority: 1SortPriority: 0CaseSensitive: false- Regex: "^<.*"Priority: 2SortPriority: 0CaseSensitive: false- Regex: ".*"Priority: 3SortPriority: 0CaseSensitive: false
IncludeIsMainRegex: "([-_](test|unittest))?$"
IncludeIsMainSourceRegex: ""
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ""
MacroBlockEnd: ""
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
RawStringFormats:- Language: CppDelimiters:- cc- CC- cpp- Cpp- CPP- "c++"- "C++"CanonicalDelimiter: ""BasedOnStyle: google- Language: TextProtoDelimiters:- pb- PB- proto- PROTOEnclosingFunctions:- EqualsProto- EquivToProto- PARSE_PARTIAL_TEXT_PROTO- PARSE_TEST_PROTO- PARSE_TEXT_PROTO- ParseTextOrDie- ParseTextProtoOrDie- ParseTestProto- ParsePartialTestProtoCanonicalDelimiter: ""BasedOnStyle: google
SortIncludes: false
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Auto
StatementMacros:- Q_UNUSED- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:- STRINGIZE- PP_STRINGIZE- BOOST_PP_STRINGIZE- NS_SWIFT_NAME- CF_SWIFT_NAME
---

相关新闻

  • 通过SSH转发端口
  • CVPR 2024 目标检测!开放词汇
  • linux apache 解析php

最新新闻

  • 围棋AI分析神器 LizzieYzy:从零到精通的完整指南
  • NXP MCAT与FreeMASTER:FOC电机控制可视化调试实战指南
  • 如何用Xournal++实现完美数字笔记体验:3个步骤掌握跨平台手写批注
  • 5分钟快速解锁B站缓存视频:m4s转MP4的完整教程
  • 如何完整保存小红书内容:XHS-Downloader工具终极指南
  • D2DX宽屏补丁:让经典《暗黑破坏神2》在现代PC上完美重生的终极方案

日新闻

  • Visual C++运行库修复终极指南:5分钟快速解决Windows软件启动错误
  • 手把手教你构建统计局地区经济数据爬虫:从环境搭建到数据持久化全指南
  • 2026多Agent深度解析:用AI团队替代单一模型,四种架构实战落地

周新闻

  • Visual C++运行库修复终极指南:5分钟快速解决Windows软件启动错误
  • 手把手教你构建统计局地区经济数据爬虫:从环境搭建到数据持久化全指南
  • 2026多Agent深度解析:用AI团队替代单一模型,四种架构实战落地

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号