Astyle对应.clang-format

复制代码
---
Language: Cpp

# 基础风格
BasedOnStyle: LLVM

# BSD / Allman 风格括号
BreakBeforeBraces: Allman

# 缩进
IndentWidth: 4
TabWidth: 4
UseTab: Never

# namespace 缩进
NamespaceIndentation: All

# class 访问修饰符缩进
AccessModifierOffset: -4
IndentAccessModifiers: false

# switch/case
IndentCaseLabels: false
IndentCaseBlocks: false

# 预处理
IndentPPDirectives: None

# 指针与引用
PointerAlignment: Right
ReferenceAlignment: Pointer

# 空格
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true

# 运算符对齐
AlignOperands: Align

# 连续赋值不对齐
AlignConsecutiveAssignments: None

# 括号换行
BreakBeforeBinaryOperators: None

# 一行语句
AllowShortBlocksOnASingleLine: Always
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline

# else if 保持同一行
BeforeElse: false

# 模板 >>
SpacesInAngles: Never

# 空行
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1

# 注释
ReflowComments: false

# 行宽
ColumnLimit: 0

# 多行条件缩进
ContinuationIndentWidth: 8

# include 排序
SortIncludes: false

# C++11
Standard: c++11
...
相关推荐
2501_9160088920 小时前
iOS App 图标、启动屏和多语言搭配 方法,上架前使用KXBuild一次做好 App 图标
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
2501_9159184120 小时前
iOS 推送通知怎么实现,从 APNs p8 密钥到 iOS 真机收到第一条推送
vscode·ios·objective-c·个人开发·swift·敏捷流程
sunshine22 girl2 天前
copilot vscode 使用技巧
人工智能·vscode·编辑器
2501_915909062 天前
Windows 打开 Xcode 工程,编译调试 Xcode 项目并和 Mac 同事协作
ide·windows·vscode·macos·ios·个人开发·xcode
2501_916007473 天前
Windows OpenSSL 生成 iOS 证书,制作 p12 与描述文件,KXBuild 签名实操
windows·vscode·ios·objective-c·个人开发·swift·敏捷流程
我要见SA姐13 天前
Chrome 内存泄漏诊断指南:从现象定位到根因排查
ide·vscode·python·自动化·编辑器
00后程序员张3 天前
Windows 开发 iOS App 入门,用 SwiftUI 写第一个 iOS App 装到 iPhone
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
Eiceblue4 天前
用 Python 给 Word 文档加水印:文字、图片与批量处理
开发语言·vscode·python·word
2501_915921434 天前
KXBuild CI 实操,Windows/Linux 服务器接入 Jenkins 打包 iOS IPA
服务器·windows·vscode·ios·ci/cd·个人开发·敏捷流程
Lhan.zzZ4 天前
用 Qt 构建线程安全的通讯静态库:从线程亲和性到完整工程
c++·vscode·qt·tcp/ip·udp