Coder Social home page Coder Social logo

clang-format's Introduction

.clang-format

.clang-format是XcodeClangFormat格式化工具自定义格式化规则文件(Xcode自定义代码格式化样式文件)。 文件内容如下,也可以自己修改。具体讲解可以看这篇文章

# 工具 https://github.com/mapbox/XcodeClangFormat
# 函数名详细地址 英文 http://clang.llvm.org/docs/ClangFormatStyleOptions.html
# 函数名详细地址 中文 https://www.cnblogs.com/PaulpauL/p/5929753.html

# 基于样式
BasedOnStyle: LLVM

# 对齐注释
AlignTrailingComments: true

# 指针和引用的对齐方式
PointerAlignment: Right

# 用于缩进的列数
IndentWidth: 4

# switch的case缩进
IndentCaseLabels: true

# OC里面,在@property后加空格
ObjCSpaceAfterProperty: true

# OC里面,在Protocol前后加空格
ObjCSpaceBeforeProtocolList: true

# 单行注释前的空格数
SpacesBeforeTrailingComments: 1

# 连续的空行保留几行
MaxEmptyLinesToKeep: 1

# 保留block里面的空行
KeepEmptyLinesAtTheStartOfBlocks: false

# 每行字符的限制,0表示没有限制
ColumnLimit: 0

# []中添加空格
SpacesInSquareBrackets: false

# ()中添加空格
SpacesInParentheses : false

# 容器类前添加空格
SpacesInContainerLiterals: true

# 赋值运算符前加空格
SpaceBeforeAssignmentOperators: true

# 在空括号中加空格
SpaceInEmptyParentheses: false

# 在<>中间插入空格
SpacesInAngles: false

# 换行的时候对齐操作符
AlignOperands: true

# 括号中的(),{},[]代码对齐方式
#AlignAfterOpenBracket: Align

#ContinuationIndentWidth: 0

# 赋值=对齐
AlignConsecutiveAssignments: false

# 声明参数对齐
AlignConsecutiveDeclarations: false

# 运算符位置
BreakBeforeBinaryOperators: None

# 允许短的函数放在同一行
#AllowShortFunctionsOnASingleLine: None

# 允许case在同一行
AllowShortCaseLabelsOnASingleLine: false

# 允许if在同一行
AllowShortIfStatementsOnASingleLine: false

# 允许while在同一行
AllowShortLoopsOnASingleLine: false

# 允许将简单的语句块放到同一行
AllowShortBlocksOnASingleLine: false

#缩进函数名
IndentWrappedFunctionNames: false

# 形参 如果为false要么都在同一行,要么各有一行
BinPackParameters: false

# 实参 如果为false要么都在同一行,要么各有一行
BinPackArguments: false

# 大括号换行
BreakBeforeBraces: Custom
BraceWrapping:
  # class定义后面
  AfterClass: true
  # 控制语句后面
  AfterControlStatement: false
  # enum定义后面
  AfterEnum: false
  # 函数定义后面
  AfterFunction: false
  # 命名空间定义后面
  AfterNamespace: false
  # struct定义后面
  AfterStruct: false
  # union定义后面
  AfterUnion: false
  # catch之前
  BeforeCatch: false

clang-format's People

Contributors

huanghaipo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.