diff --git a/README.md b/README.md index 6a5bd9d..3545b52 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Thus UniversalIndentGUI is open for nearly any new indenter and programming lang * [Artistic Styler](http://astyle.sourceforge.net/) * [BCPP](http://invisible-island.net/bcpp/) +* [ClangFormat](https://releases.llvm.org/17.0.0/tools/clang/docs/ClangFormat.html) * [Cobol Beautify](http://www.siber.com/sct/tools/cbl-beau.html) * [CSSTidy](http://csstidy.sourceforge.net/) * [Fortran 90 PPR](ftp://ftp.ifremer.fr/ifremer/ditigo/fortran90/) @@ -140,7 +141,7 @@ But if you'd like to build UiGUI from source, follow these steps: 5. Run "make release". 6. Install it **Indenter binary packages** can be downloaded from the project at SourceForge - [here](http://sourceforge.net/project/showfiles.php?group_id=167482&package_id=293094). + [here](http://sourceforge.net/project/showfiles.php?group_id=167482&package_id=293094). **ClangFormat** is not part of them (yet), and you can download it separately at [the LLVM Builds page](http://llvm.org/builds/). (Rename it to `clang-format.exe` after downloading if needed.) Beneath the possibility to build UiGUI using qmake, also project files for Visual Studio 2005 and XCode are included. diff --git a/README_older_but_worth_reading.txt b/README_older_but_worth_reading.txt index 534c4d2..286a352 100644 --- a/README_older_but_worth_reading.txt +++ b/README_older_but_worth_reading.txt @@ -17,6 +17,7 @@ One of the main features and the reason why this tool was (better is being) deve - Supports the following indenters: * Artistic Styler * BCPP + * ClangFormat * Cobol Beautifier * CSS Tidy * GNU Indent diff --git a/buildRelease.sh b/buildRelease.sh index 616ee90..4989039 100755 --- a/buildRelease.sh +++ b/buildRelease.sh @@ -348,7 +348,7 @@ echo "" echo "Copying the indenter executable files to the target indenters dir" echo "-----------------------------------------------------------------" # This list does not include script based indenters. These are copied somewhere below. -indenters="astyle$ext astyle.html uncrustify$ext uncrustify.txt xmlindent$ext xmlindent.txt" +indenters="astyle$ext astyle.html clang-format$ext uncrustify$ext uncrustify.txt xmlindent$ext xmlindent.txt" # For win32 and Linux add some indenters that do not run or exist under MaxOSX if [ "$targetSystem" = "win32" ] || [ "$targetSystem" = "linux" ]; then indenters="$indenters bcpp$ext bcpp.txt csstidy$ext f90ppr.exe f90ppr.txt greatcode.exe greatcode.txt htb.exe htb.html indent$ext indent.html phpCB.html phpCB.exe psti_license.txt psti_manual.html psti.exe tidy$ext tidy.html vbsbeaut_keywords_indent.txt vbsbeaut_keywords.txt vbsbeaut.bat vbsbeaut.exe" diff --git a/buildwin32release_gcc.bat b/buildwin32release_gcc.bat index 1ea7b40..014d690 100644 --- a/buildwin32release_gcc.bat +++ b/buildwin32release_gcc.bat @@ -55,7 +55,7 @@ echo. echo Copying the indenter executables and example file to the release indenters dir echo ------------------------------------------------------------------------------ -FOR %%A IN ( astyle.exe, astyle.html, bcpp.exe, bcpp.txt, csstidy.exe, gc.exe, gc.txt, indent.exe, libiconv-2.dll, libintl-2.dll, indent.html, JsDecoder.js, perltidy, PerlTidyLib.pm, phpStylist.php, phpStylist.txt, rbeautify.rb, ruby_formatter.rb, shellindent.awk, tidy.exe, tidy.html, uncrustify.exe, uncrustify.txt, xmlindent.exe, xmlindent.txt ) DO ( +FOR %%A IN ( astyle.exe, astyle.html, bcpp.exe, bcpp.txt, clang-format.exe csstidy.exe, gc.exe, gc.txt, indent.exe, libiconv-2.dll, libintl-2.dll, indent.html, JsDecoder.js, perltidy, PerlTidyLib.pm, phpStylist.php, phpStylist.txt, rbeautify.rb, ruby_formatter.rb, shellindent.awk, tidy.exe, tidy.html, uncrustify.exe, uncrustify.txt, xmlindent.exe, xmlindent.txt ) DO ( if not exist .\indenters\%%A ( echo WARNING!! File .\indenters\%%A not found! set warningsoccurred=true diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini new file mode 100644 index 0000000..abf16d1 --- /dev/null +++ b/indenters/uigui_clangformat.ini @@ -0,0 +1,1782 @@ +[header] +categories="Overall Policy|Breaking and Joining|Brace Positioning|Indentation|Alignment|Horizontal Spacing|Vertical Spacing|Other Edits" +cfgFileParameterEnding=cr +configFilename=.clang-format +fileTypes=*.cpp|*.cxx|*.C|*.c|*.h|*.hpp|*.java|*.js|*.json|*.m|*.mm|*.M|*.proto|*.cs +indenterFileName=clang-format +indenterName=ClangFormat (C, C++, Java, JavaScript, JSON, ObjC, ObjC++, ProtoBuf, C#, Verilog) +inputFileName=indentinput +inputFileParameter="-style=file -i " +manual=https://releases.llvm.org/17.0.0/tools/clang/docs/ClangFormatStyleOptions.html +outputFileName=indentinput +outputFileParameter=none +parameterOrder=pio +stringparaminquotes=false +showHelpParameter=-help +useCfgFileParameter=none +version=17.0.0 + +[Language] +Category=0 +Description="(Language) Language this format style is targeted at." +EditorType=multiple +Enabled=true +Choices="Language: Cpp|Language: Java|Language: JavaScript|Language: Json|Language: ObjC|Language: Proto|Language: TextProto|Language: TableGen|Language: CSharp|Language: Verilog" +ChoicesReadable="(Cpp) C, C++|(Java) Java|(JavaScript) JavaScript|(Json) JSON|(ObjC) Objective C, Objective C++|(Proto) Protocol Buffers|(TextProto) Protocol Buffer messages in text format|(TableGen) TableGen|(CSharp) C#|(Verilog) Verilog and SystemVerilog" +ValueDefault=0 + +[BasedOnStyle] +Category=0 +Description="(BasedOnStyle) The style used for all options not specifically set in the configuration." +EditorType=multiple +Enabled=false +Choices="BasedOnStyle: LLVM|BasedOnStyle: Google|BasedOnStyle: Chromium|BasedOnStyle: Mozilla|BasedOnStyle: WebKit|BasedOnStyle: Microsoft|BasedOnStyle: GNU|BasedOnStyle: InheritParentConfig" +ChoicesReadable="(LLVM) LLVM coding standards - https://llvm.org/docs/CodingStandards.html|(Google) Google’s C++ style guide - https://google.github.io/styleguide/cppguide.html|(Chromium) Chromium’s style guide - https://chromium.googlesource.com/chromium/src/+/refs/heades/main/styleguide/styleguide.md|(Mozilla) Mozilla’s style guide - https://firefox-source-docs.mozilla.org/code-quality/coding-style/index.html|(WebKit) WebKit’s style guide - https://www.webkit.org/coding/coding-style.html|(Microsoft) Microsoft’s style guide - https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference|(GNU) GNU coding standards - https://www.gnu.org/prep/standards/standards.html|(InheritParentConfig) Not a real style, but allows to use the .clang-format file from the parent directory (or its parent if there is none)." +ValueDefault=0 + +[AccessModifierOffset] +Category=4 +Description="The extra indent or outdent of access modifiers, e.g. public:." +EditorType=numeric +Enabled=false +CallName="AccessModifierOffset: " +MaxVal=100 +MinVal=-100 +Value=-2 +ValueDefault=-2 + +[AlignAfterOpenBracket] +Category=4 +Description="(AlignAfterOpenBracket) Horizontally aligns arguments after an open bracket.

This applies to round brackets (parentheses), angle brackets and square brackets." +EditorType=multiple +Enabled=false +Choices="AlignAfterOpenBracket: Align|AlignAfterOpenBracket: DontAlign|AlignAfterOpenBracket: AlwaysBreak|AlignAfterOpenBracket: BlockIndent" +ChoicesReadable="(Align) Align parameters on the open bracket.|(DontAlign) Don’t align, instead use ContinuationIndentWidth.|(AlwaysBreak) Always break after an open bracket if the parameters don’t fit on a single line.|(BlockIndent) Always break after an open bracket, if the parameters don't fit on a single line. Closing brackets will be placed on a new line. Note: This currently only applies to braced initializer lists (when Cpp11BracedListStyle is true) and parentheses." +ValueDefault=0 + +[AlignArrayOfStructures] +Category=4 +Description="(AlignArrayOfStructures) if not None, when using initialization for an array of structs aligns the fields into columns.

Note
As of clang-format 15 this option only applied to arrays with equal number of columns per row.

" +EditorType=multiple +Enabled=false +Choices="AlignArrayOfStructures: Left|AlignArrayOfStructures: Right|AlignArrayOfStructures: None" +ChoicesReadable="(Left) Align array column and left justify the columns|(Right) Align array column and right justify the columns|(None) Don't align array initializer columns." +ValueDefault=2 + +[AlignConsecutiveAssignments] +Category=4 +Description="Style of aligning consecutive assignments." +EditorType=boolean +TrueFalse="AlignConsecutiveAssignments:|AlignConsecutiveAssignments:" +Value=1 +ValueDefault=1 + +[ - Enabled] +Category=4 +Description="Whether aligning is enabled.
#define SHORT_NAME       42
#define LONGER_NAME 0x007f
#define EVEN_LONGER_NAME (2)
#define foo(x) (x * x)
#define bar(y, z) (y + z)

int a = 1;
int somelongname = 2;
double c = 3;

int aaaa : 1;
int b : 12;
int ccc : 8;

int aaaa = 12;
float b = 23;
std::string ccc;
" +EditorType=boolean +TrueFalse=" Enabled: true| Enabled: false" +Value=0 +ValueDefault=0 + +[ - AcrossEmptyLines] +Category=4 +Description="Whether to align across empty lines.
true:
int a = 1;
int somelongname = 2;
double c = 3;

int d = 3;

false:
int a = 1;
int somelongname = 2;
double c = 3;

int d = 3;
" +EditorType=boolean +TrueFalse=" AcrossEmptyLines: true| AcrossEmptyLines: false" +Value=0 +ValueDefault=0 + +[ - AcrossComments] +Category=4 +Description="Whether to align across comments.
true:
int d = 3;
/* A comment. */
double e = 4;

false:
int d = 3;
/* A comment. */
double e = 4;
" +EditorType=boolean +TrueFalse=" AcrossComments: true| AcrossComments: false" +Value=0 +ValueDefault=0 + +[ - AlignCompound] +Category=4 +Description="Only for AlignConsecutiveAssignments. Whether compound assignments like += are aligned along with =.
true:
a &= 2;
bbb = 2;

false:
a &= 2;
bbb = 2;
" +EditorType=boolean +TrueFalse=" AlignCompound: true| AlignCompound: false" +Value=0 +ValueDefault=0 + +[ - PadOperators] +Category=4 +Description="Only for AlignConsecutiveAssignments. Whether short assignment operators are left-padded to the same length as long ones in order to put all assignment operators to the right of the left hand side.
true:
a >>= 2;
bbb = 2;

a = 2;
bbb >>= 2;

false:
a >>= 2;
bbb = 2;

a = 2;
bbb >>= 2;
" +EditorType=boolean +TrueFalse=" PadOperators: true| PadOperators: false" +Value=0 +ValueDefault=0 + +[AlignConsecutiveBitFields] +Category=4 +Description="(AlignConsecutiveBitFields) Style of aligning consecutive bit fields.

Consecutive will align the bitfield separators of consecutive lines. This will result in formattings like:

int aaaa : 1;
int b : 12;
int ccc : 8;
" +EditorType=multiple +Enabled=false +Choices="AlignConsecutiveBitFields: None|AlignConsecutiveBitFields: Consecutive|AlignConsecutiveBitFields: AcrossEmptyLines|AlignConsecutiveBitFields: AcrossComments|AlignConsecutiveBitFields: AcrossEmptyLinesAndComments" +ChoicesReadable="(None) Do not align bit fields on consecutive lines.|(Consecutive) Align bit fields on consecutive lines.|(AcrossEmptyLines) Same as Consecutive, but also spans over empty lines.|(AcrossComments) Same as Consecutive, but also spans over lines only containing comments.|(AcrossEmptyLinesAndComments) Same as Consecutive, but also spans over lines only containing comments and empty lines." +ValueDefault=0 + +[AlignConsecutiveDeclarations] +Category=4 +Description="(AlignConsecutiveDeclarations) Style of aligning consecutive declarations.

Consecutive will align the declaration names of consecutive lines. This will result in formattings like:

int         aaaa = 12;
float b = 23;
std::string ccc;
" +EditorType=multiple +Enabled=false +Choices="AlignConsecutiveDeclarations: None|AlignConsecutiveDeclarations: Consecutive|AlignConsecutiveDeclarations: AcrossEmptyLines|AlignConsecutiveDeclarations: AcrossComments|AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments" +ChoicesReadable="(None) Do not align bit declarations on consecutive lines.|(Consecutive) Align declarations on consecutive lines.|(AcrossEmptyLines) Same as Consecutive, but also spans over empty lines.|(AcrossComments) Same as Consecutive, but also spans over lines only containing comments.|(AcrossEmptyLinesAndComments) Same as Consecutive, but also spans over lines only containing comments and empty lines." +ValueDefault=0 + +[AlignConsecutiveMacros] +Category=4 +Description="(AlignConsecutiveMacros) Style of aligning consecutive macro definitions.

Consecutive will result in formattings like:

#define SHORT_NAME       42
#define LONGER_NAME 0x007f
#define EVEN_LONGER_NAME (2)
#define foo(x) (x * x)
#define bar(y, z) (y + z)
" +EditorType=multiple +Enabled=false +Choices="AlignConsecutiveMacros: None|AlignConsecutiveMacros: Consecutive|AlignConsecutiveMacros: AcrossEmptyLines|AlignConsecutiveMacros: AcrossComments|AlignConsecutiveMacros: AcrossEmptyLinesAndComments" +ChoicesReadable="(None) Do not align macro definitions on consecutive lines.|(Consecutive) Align macro definitions on consecutive lines.|(AcrossEmtpyLines) Same as Consecutive, but also spans over empty lines.|(AcrossComments) Same as Consecutive, but also spans over lines only containing comments.|(AcrossEmptyLinesAndComments) Same as Consecutive, but also spans over lines only containing comments and empty lines." +ValueDefault=0 + +[AlignConsecutiveShortCaseStatements] +Category=4 +Description="Style of aligning consecutive short case labels. Only applies if AllowShortCaseLabelsOnASingleLine is true.
# Example of usage:
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCaseColons: false
" +EditorType=boolean +TrueFalse="AlignConsecutiveShortCaseStatements:|AlignConsecutiveShortCaseStatements:" +Value=1 +ValueDefault=1 + +[ - Enabled (AlignConsecutiveShortCaseStatements)] +Category=4 +Description="Whether aligning is enabled.
true:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}

false:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}
" +EditorType=boolean +TrueFalse=" Enabled: true| Enabled: false" +Value=0 +ValueDefault=0 + +[ - AcrossEmptyLines (AlignConsecutiveShortCaseStatements)] +Category=4 +Description="Whether to align across empty lines.
true:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";

default: return "";
}

false:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}
" +EditorType=boolean +TrueFalse=" AcrossEmptyLines: true| AcrossEmptyLines: false" +Value=0 +ValueDefault=0 + +[ - AcrossComments (AlignConsecutiveShortCaseStatements)] +Category=4 +Description="Whether to align across comments.
true:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
/* A comment. */
default: return "";
}

false:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
/* A comment. */
default: return "";
}
" +EditorType=boolean +TrueFalse=" AcrossComments: true| AcrossComments: false" +Value=0 +ValueDefault=0 + +[ - AlignCaseColons (AlignConsecutiveShortCaseStatements)] +Category=4 +Description="Whether aligned case labels are aligned on the colon, or on the , or on the tokens after the colon.
true:
switch (level) {
case log::info : return "info:";
case log::warning: return "warning:";
default : return "";
}

false:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}
" +EditorType=boolean +TrueFalse=" AlignCaseColons: true| AlignCaseColons: false" +Value=0 +ValueDefault=0 + +[AlignEscapedNewlines] +Category=4 +Description="(AlignEscapedNewlines) Options for aligning backslashes in escaped newlines." +EditorType=multiple +Enabled=false +Choices="AlignEscapedNewlines: DontAlign|AlignEscapedNewlines: Left|AlignEscapedNewlines: Right" +ChoicesReadable="(DontAlign) Don’t align escaped newlines.|(Left) Align escaped newlines as far left as possible.|(Right) Align escaped newlines in the right-most column." +ValueDefault=2 + +[AlignOperands] +Category=4 +Description="(AlignOperands) Horizontally align operands of binary and ternary expressions." +EditorType=multiple +Enabled=false +Choices="AlignOperands: DontAlign|AlignOperands: Align|AlignOperands: AlignAfterOperator" +ChoicesReadable="(DontAlign) Do not align operands of binary and ternary expressions. The wrapped lines are indented ContinuationIndentWidth spaces from the start of the line.|(Align) Align operands of a single expression that needs to be split over multiple lines. When BreakBeforeBinaryOperators is set, the wrapped operator is aligned with the operand on the first line.|(AlignAfterOperator) Similar to Align, except when BreakBeforeBinaryOperators is set, the operator is un-indented so that the wrapped operand is aligned with the operand on the first line." +ValueDefault=1 + +[AlignTrailingComments] +Category=4 +Description="Control of trailing comments.

Note
As of clang-format 16 this option is not a bool but can be set to the options. Conventional bool options still can be parsed as before.

# Example of usage:
AlignTrailingComments:
Kind: Always
OverEmptyLines: 2
" +EditorType=boolean +TrueFalse="AlignTrailingComments:|AlignTrailingComments:" +Value=1 +ValueDefault=1 + +[ - Kind] +Category=4 +Description="( - Kind) Specifies the way to align trailing comments." +EditorType=multiple +Enabled=true +Choices=" Kind: Leave| Kind: Always| Kind: Never" +ChoicesReadable="(Leave) Leave trailing comments as they are.|(Always) Align trailing comments.|(Never) Don't align trailing comments but other formatter applies." +ValueDefault=2 + +[ - OverEmptyLines] +Category=4 +Description="How many empty lines to apply alignment.

When both MaxEmptyLinesToKeep and OverEmptyLines are set to 2, it formats like below.

int a;      // all these

int ab; // comments are


int abcdef; // aligned
When MaxEmptyLinesToKeep is set to 2 and OverEmptyLines is set to 1, it formats like below.
int a;  // these are

int ab; // aligned


int abcdef; // but this isn't

" +EditorType=numeric +Enabled=true +CallName=" OverEmptyLines: " +MaxVal=65535 +MinVal=0 +Value=0 +ValueDefault=0 + +[AllowAllArgumentsOnNextLine] +Category=1 +Description="If a function call or braced initializer list doesn’t fit on a line, allow putting all arguments onto the next line, even if BinPackArguments is false.
true:
callFunction(
a, b, c, d);

false:
callFunction(a,
b,
c,
d);
" +EditorType=boolean +TrueFalse="AllowAllArgumentsOnNextLine: true|AllowAllArgumentsOnNextLine: false" +Value=1 +ValueDefault=1 + +[AllowAllConstructorInitializersOnNextLine] +Category=1 +Description="This option is deprecated. See NextLine of PackConstructorInitializers." +EditorType=boolean +TrueFalse="AllowAllConstructorInitializersOnNextLine: true|AllowAllConstructorInitializersOnNextLine: false" +Value=1 +ValueDefault=1 + +[AllowAllParametersOfDeclarationOnNextLine] +Category=1 +Description="If the function declaration doesn’t fit on a line, allow putting all parameters of a function declaration onto the next line even if BinPackParameters is false.
true:
void myFunction(
int a, int b, int c, int d, int e);

false:
void myFunction(int a,
int b,
int c,
int d,
int e);
" +EditorType=boolean +TrueFalse="AllowAllParametersOfDeclarationOnNextLine: true|AllowAllParametersOfDeclarationOnNextLine: false" +Value=1 +ValueDefault=1 + +[AllowShortBlocksOnASingleLine] +Category=1 +Description="(AllowShortBlocksOnASingleLine) Allows contracting simple braced statements to a single line.

E.g., this allows if (a) { return; } to be put on a single line (if AllowShortIfStatementsOnASingleLine is also enabled)." +EditorType=multiple +Enabled=false +Choices="AllowShortBlocksOnASingleLine: Never|AllowShortBlocksOnASingleLine: Empty|AllowShortBlocksOnASingleLine: Always" +ChoicesReadable="(Never) Never merge blocks into a single line.|(Empty) Only merge empty blocks.|(Always) Always merge short blocks into a single line." +ValueDefault=0 + +[AllowShortCaseLabelsOnASingleLine] +Category=1 +Description="Contracts short case labels to a single line.

true:                                   false:
switch (a) { vs. switch (a) {
case 1: x = 1; break; case 1:
case 2: return; x = 1;
} break;
case 2:
return;
}
" +EditorType=boolean +TrueFalse="AllowShortCaseLabelsOnASingleLine: true|AllowShortCaseLabelsOnASingleLine: false" +Value=0 +ValueDefault=0 + +[AllowShortEnumsOnASingleLine] +Category=1 +Description="Allow short enums on a single line.
true:
enum { A, B } myEnum;

false:
enum {
A,
B
} myEnum;
" +EditorType=boolean +TrueFalse="AllowShortEnumsOnASingleLine: true|AllowShortEnumsOnASingleLine: false" +Value=1 +ValueDefault=1 + +[AllowShortFunctionsOnASingleLine] +Category=1 +Description="(AllowShortFunctionsOnASingleLine) int f() { return 0; } can be put on a single line." +EditorType=multiple +Enabled=false +Choices="AllowShortFunctionsOnASingleLine: None|AllowShortFunctionsOnASingleLine: InlineOnly|AllowShortFunctionsOnASingleLine: Empty|AllowShortFunctionsOnASingleLine: Inline|AllowShortFunctionsOnASingleLine: All" +ChoicesReadable="(None) Never merge functions into a single line.|(InlineOnly) Only merge functions defined inside a class.|(Empty) Only merge empty functions.|(Inline) Only merge functions defined inside a class. Implies “empty”.|(All) Merge all functions fitting on a single line." +ValueDefault=4 + +[AllowShortIfStatementsOnASingleLine] +Category=1 +Description="(AllowShortIfStatementsOnASingleLine) Dependent on the value, if (a) return; can be put on a single line." +EditorType=multiple +Enabled=false +Choices="AllowShortIfStatementsOnASingleLine: Never|AllowShortIfStatementsOnASingleLine: WithoutElse|AllowShortIfStatementsOnASingleLine: OnlyFirstIf|AllowShortIfStatementsOnASingleLine: AllIfsAndElse" +ChoicesReadable="(Never) Never put short ifs on the same line.|(WithoutElse) Put short ifs on the same line only if there is no else statement.|(OnlyFirstIf) Put short ifs, but not else ifs nor else statements, on the same line.|(AllIfsAndElse) Always put short ifs, else ifs and else statements on the same line." +ValueDefault=0 + +[AllowShortLambdasOnASingleLine] +Category=1 +Description="(AllowShortLambdasOnASingleLine) Dependent on the value, auto lambda []() { return 0; } can be put on a single line." +EditorType=multiple +Enabled=false +Choices="AllowShortLambdasOnASingleLine: None|AllowShortLambdasOnASingleLine: Empty|AllowShortLambdasOnASingleLine: Inline|AllowShortLambdasOnASingleLine: All" +ChoicesReadable="(None) Never merge lambdas into a single line.|(Empty) Only merge empty lambdas.|(Inline) Merge lambda into a single line if the lambda is argument of a function.|(All) Merge all lambdas fitting on a single line." +ValueDefault=3 + +[AllowShortLoopsOnASingleLine] +Category=1 +Description="while (true) continue; can be put on a single line.

Note: To put do { true; } while(0); on a single line, AllowShortBlocksOnASingleLine is also needed." +EditorType=boolean +TrueFalse="AllowShortLoopsOnASingleLine: true|AllowShortLoopsOnASingleLine: false" +Value=0 +ValueDefault=0 + +[AlwaysBreakAfterReturnType] +Category=1 +Description="(AlwaysBreakAfterReturnType) The function return type breaking style to use." +EditorType=multiple +Enabled=false +Choices="AlwaysBreakAfterReturnType: None|AlwaysBreakAfterReturnType: All|AlwaysBreakAfterReturnType: TopLevel|AlwaysBreakAfterReturnType: AllDefinitions|AlwaysBreakAfterReturnType: TopLevelDefinitions" +ChoicesReadable="(None) Break after return type automatically according to PenaltyReturnTypeOnItsOwnLine.|(All) Always break after the return type.|(TopLevel) Always break after the return types of top-level functions.|(AllDefinitions) Always break after the return type of function definitions.|(TopLevelDefinitions) Always break after the return type of top-level definitions." +ValueDefault=0 + +[AlwaysBreakBeforeMultilineStrings] +Category=1 +Description="Always break before multiline string literals.

This flag is meant to make cases where there are multiple multiline strings in a file look more consistent. Thus, it will only take effect if wrapping the string at that point leads to it being indented ContinuationIndentWidth spaces from the start of the line.

true:                                  false:
aaaa = vs. aaaa = "bbbb"
"bbbb" "cccc";
"cccc";
" +EditorType=boolean +TrueFalse="AlwaysBreakBeforeMultilineStrings: true|AlwaysBreakBeforeMultilineStrings: false" +Value=0 +ValueDefault=0 + +[AlwaysBreakTemplateDeclarations] +Category=1 +Description="(AlwaysBreakTemplateDeclarations) The template declaration breaking style to use." +EditorType=multiple +Enabled=false +Choices="AlwaysBreakTemplateDeclarations: No|AlwaysBreakTemplateDeclarations: MultiLine|AlwaysBreakTemplateDeclarations: Yes" +ChoicesReadable="(No) Do not force break before declaration. PenaltyBreakTemplateDeclaration is taken into account.|(MultiLine) Force break after template declaration only when the following declaration spans multiple lines.|(Yes) Always break after template declaration." +ValueDefault=0 + +[AttributeMacros] +Category=7 +Description="A vector of strings that should be interpreted as attributes/qualifiers instead of identifiers. This can be useful for language extensions or static analyzer annotations.

For example:

x = (char *__capability)&y;
int function(void) __ununsed;
void only_writes_to_buffer(char *__output buffer);

In the .clang-format configuration file, this can be configured like:

AttributeMacros: ['__capability', '__output', '__ununsed']
" +EditorType=string +CallName="AttributeMacros: " +Enabled=false +Value="['__capability']" +ValueDefault="['__capability']" + +[BinPackArguments] +Category=1 +Description="If false, a function call’s arguments will either be all on the same line or will have one line each.
true:
void f() {
f(aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
}

false:
void f() {
f(aaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
}
" +EditorType=boolean +TrueFalse="BinPackArguments: true|BinPackArguments: false" +Value=1 +ValueDefault=1 + +[BinPackParameters] +Category=1 +Description="If false, a function declaration’s or function definition’s parameters will either all be on the same line or will have one line each.
true:
void f(int aaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaa,
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}

false:
void f(int aaaaaaaaaaaaaaaaaaaa,
int aaaaaaaaaaaaaaaaaaaa,
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
" +EditorType=boolean +TrueFalse="BinPackParameters: true|BinPackParameters: false" +Value=1 +ValueDefault=1 + +[BitFieldColonSpacing] +Category=5 +Description="(BitFieldColonSpacing) The BitFieldColonSpacingStyle to use for bitfields." +EditorType=multiple +Enabled=false +Choices="BitFieldColonSpacing: Both|BitFieldColonSpacing: None|BitFieldColonSpacing: Before|BitFieldColonSpacing: After" +ChoicesReadable="(Both) Add one space on each side of the ':'|(None) Add no space around the ':' (except when needed for AlignConsecutiveBitFields).|(Before) Add space before the ':' only|(After) Add space after the ':' only (space may be added before if needed for AlignConsecutiveBitFields)." +ValueDefault=0 + +[BreakBeforeBraces] +Category=2 +Description="(BreakBeforeBraces) The brace breaking style to use." +EditorType=multiple +Enabled=false +Choices="BreakBeforeBraces: Attach|BreakBeforeBraces: Linux|BreakBeforeBraces: Mozilla|BreakBeforeBraces: Stroustrup|BreakBeforeBraces: Allman|BreakBeforeBraces: Whitesmiths|BreakBeforeBraces: GNU|BreakBeforeBraces: WebKit|BreakBeforeBraces: Custom" +ChoicesReadable="(Attach) Always attach braces to surrounding context.|(Linux) Like Attach, but break before braces on function, namespace and class definitions.|(Mozilla) Like Attach, but break before braces on enum, function, and record definitions.|(Stroustrup) Like Attach, but break before function definitions, catch, and else.|(Allman) Always break before braces.|(Whitesmiths) Like Allman but always indent braces and line up code with braces.|(GNU) Always break before braces and add an extra level of indentation to braces of control statements, not to those of class, function or other definitions.|(WebKit) Like Attach, but break before functions.|(Custom) Configure each individual brace in BraceWrapping." +ValueDefault=0 + +[BraceWrapping] +Category=2 +Description="Control of individual brace wrapping cases.

If BreakBeforeBraces is set to Custom, use the following options to specify how each individual brace case should be handled. Otherwise, this is ignored." +EditorType=boolean +TrueFalse="BraceWrapping:|BraceWrapping:" +Value=1 +ValueDefault=1 + +[ - AfterCaseLabel] +Category=2 +Description="Wrap case labels.

false:                                true:
switch (foo) { vs. switch (foo) {
case 1: { case1:
bar(); {
break; bar();
} break;
default: { }
plop(); default:
} {
} plop();
}
}
" +EditorType=boolean +TrueFalse=" AfterCaseLabel: true| AfterCaseLabel: false" +Value=0 +ValueDefault=0 + +[ - AfterClass] +Category=2 +Description="Wrap class definitions.
true:
class foo
{};

false:
class foo {};
" +EditorType=boolean +TrueFalse=" AfterClass: true| AfterClass: false" +Value=0 +ValueDefault=0 + +[ - AfterControlStatement] +Category=2 +Description="( - AfterControlStatement) Wrap control statements (if/for/while/switch/..)." +EditorType=multiple +Enabled=false +Choices=" AfterControlStatement: Never| AfterControlStatement: MultiLine| AfterControlStatement: Always" +ChoicesReadable="(Never) Never wrap braces after a control statement.|(MultiLine) Only wrap braces after a multi-line control statement.|(Always) Always wrap braces after a control statement." +ValueDefault=0 + +[ - AfterEnum] +Category=2 +Description="Wrap enum definitions.
true:
enum X : int
{
B
};

false:
enum X : int { B };
" +EditorType=boolean +TrueFalse=" AfterEnum: true| AfterEnum: false" +Value=0 +ValueDefault=0 + +[ - AfterFunction] +Category=2 +Description="Wrap function definitions.
true:
void foo()
{
bar();
bar2();
}

false:
void foo() {
bar();
bar2();
}
" +EditorType=boolean +TrueFalse=" AfterFunction: true| AfterFunction: false" +Value=0 +ValueDefault=0 + +[ - AfterNamespace] +Category=2 +Description="Wrap namespace definitions.
true:
namespace
{
int foo();
int bar();
}

false:
namespace {
int foo();
int bar();
}
" +EditorType=boolean +TrueFalse=" AfterNamespace: true| AfterNamespace: false" +Value=0 +ValueDefault=0 + +[ - AfterObjCDeclaration] +Category=2 +Description="Wrap ObjC definitions (interfaces, implementations…).

Note
@autoreleasepool and @synchronized blocks are wrapped according to AfterControlStatement flag.

" +EditorType=boolean +TrueFalse=" AfterObjCDeclaration: true| AfterObjCDeclaration: false" +Value=0 +ValueDefault=0 + +[ - AfterStruct] +Category=2 +Description="Wrap struct definitions.
true:
struct foo
{
int x;
};

false:
struct foo {
int x;
};
" +EditorType=boolean +TrueFalse=" AfterStruct: true| AfterStruct: false" +Value=0 +ValueDefault=0 + +[ - AfterUnion] +Category=2 +Description="Wrap union definitions.
true:
union foo
{
int x;
}

false:
union foo {
int x;
}
" +EditorType=boolean +TrueFalse=" AfterUnion: true| AfterUnion: false" +Value=0 +ValueDefault=0 + +[ - AfterExternBlock] +Category=2 +Description="Wrap extern blocks.
true:
extern "C"
{
int foo();
}

false:
extern "C" {
int foo();
}
" +EditorType=boolean +TrueFalse=" AfterExternBlock: true| AfterExternBlock: false" +Value=0 +ValueDefault=0 + +[ - BeforeCatch] +Category=2 +Description="Wrap before catch.
true:
try {
foo();
}
catch () {
}

false:
try {
foo();
} catch () {
}
" +EditorType=boolean +TrueFalse=" BeforeCatch: true| BeforeCatch: false" +Value=0 +ValueDefault=0 + +[ - BeforeElse] +Category=2 +Description="Wrap before else.
true:
if (foo()) {
}
else {
}

false:
if (foo()) {
} else {
}
" +EditorType=boolean +TrueFalse=" BeforeElse: true| BeforeElse: false" +Value=0 +ValueDefault=0 + +[ - BeforeLambdaBody] +Category=2 +Description="Wrap lambda block.
true:
connect(
[]()
{
foo();
bar();
});

false:
connect([]() {
foo();
bar();
});
" +EditorType=boolean +TrueFalse=" BeforeLambdaBody: true| BeforeLambdaBody: false" +Value=0 +ValueDefault=0 + +[ - BeforeWhile] +Category=2 +Description="Wrap before while.
true:
do {
foo();
}
while (1);

false:
do {
foo();
} while (1);
" +EditorType=boolean +TrueFalse=" BeforeWhile: true| BeforeWhile: false" +Value=0 +ValueDefault=0 + +[ - IndentBraces] +Category=2 +Description="Indent the wrapped braces themselves." +EditorType=boolean +TrueFalse=" IndentBraces: true| IndentBraces: false" +Value=0 +ValueDefault=0 + +[ - SplitEmptyFunction] +Category=2 +Description="If false, empty function body can be put on a single line. This option is used only if the opening brace of the function has already been wrapped, i.e. the AfterFunction brace wrapping mode is set, and the function could/should not be put on a single line (as per AllowShortFunctionsOnASingleLine and constructor formatting options).
false:          true:
int f() vs. int f()
{} {
}
" +EditorType=boolean +TrueFalse=" SplitEmptyFunction: true| SplitEmptyFunction: false" +Value=1 +ValueDefault=1 + +[ - SplitEmptyRecord] +Category=2 +Description="If false, empty record (e.g. class, struct or union) body can be put on a single line. This option is used only if the opening brace of the record has already been wrapped, i.e. the AfterClass (for classes) brace wrapping mode is set.
false:           true:
class Foo vs. class Foo
{} {
}
" +EditorType=boolean +TrueFalse=" SplitEmptyRecord: true| SplitEmptyRecord: false" +Value=1 +ValueDefault=1 + +[ - SplitEmptyNamespace] +Category=2 +Description="If false, empty namespace body can be put on a single line. This option is used only if the opening brace of the namespace has already been wrapped, i.e. the AfterNamespace brace wrapping mode is set.
false:               true:
namespace Foo vs. namespace Foo
{} {
}
" +EditorType=boolean +TrueFalse=" SplitEmptyNamespace: true| SplitEmptyNamespace: false" +Value=1 +ValueDefault=1 + +[BracedInitializerIndentWidth] +Category=3 +Description="The number of columns to use to indent the contents of braced init lists. If unset, ContinuationIndentWidth is used.
AlignAfterOpenBracket: AlwaysBreak
BracedInitializerIndentWidth: 2

void f() {
SomeClass c{
"foo",
"bar",
"baz",
};
auto s = SomeStruct{
.foo = "foo",
.bar = "bar",
.baz = "baz",
};
SomeArrayT a[3] = {
{
foo,
bar,
},
{
foo,
bar,
},
SomeArrayT{},
};
}
" +EditorType=numeric +Enabled=false +CallName="BracedInitializerIndentWidth: " +MaxVal=2000 +MinVal=0 +Value=4 +ValueDefault=4 + +[BreakAfterAttributes] +Category=1 +Description="(BreakAfterAttributes) Break after a group of C++11 attributes before a function declaration/definition name." +EditorType=multiple +Enabled=false +Choices="BreakAfterAttributes: Always|BreakAfterAttributes: Leave|BreakAfterAttributes: Never" +ChoicesReadable="(Always) Always break after attributes.|(Leave) Leave the line breaking after attributes as is.|(Never) Never break after attributes." +ValueDefault=2 + +[BreakAfterJavaFieldAnnotations] +Category=1 +Description="Break after each annotation on a field in Java files.
true:                                  false:
@Partial vs. @Partial @Mock DataLoad loader;
@Mock
DataLoad loader;
" +EditorType=boolean +TrueFalse="BreakAfterJavaFieldAnnotations: true|BreakAfterJavaFieldAnnotations: false" +Value=0 +ValueDefault=0 + +[BreakArrays] +Category=1 +Description="If true, clang-format will always break after a Json array [ otherwise it will scan until the closing ] to determine if it should add newlines between elements (prettier compatible).

Note
This is currently only for formatting JSON.

true:                                  false:
[ vs. [1, 2, 3, 4]
1,
2,
3,
4
]
" +EditorType=boolean +TrueFalse="BreakArrays: true|BreakArrays: false" +Value=1 +ValueDefault=1 + +[BreakBeforeBinaryOperators] +Category=1 +Description="(BreakBeforeBinaryOperators) The way to wrap binary operators." +EditorType=multiple +Enabled=false +Choices="BreakBeforeBinaryOperators: None|BreakBeforeBinaryOperators: NonAssignment|BreakBeforeBinaryOperators: All" +ChoicesReadable="(None) Break after operators.|(NonAssignment) Break before operators that aren’t assignments.|(All) Break before operators." +ValueDefault=0 + +[BreakBeforeBraces] +Category=2 +Description="(BreakBeforeBraces) The brace breaking style to use." +EditorType=multiple +Enabled=false +Choices="BreakBeforeBraces: Attach|BreakBeforeBraces: Linux|BreakBeforeBraces: Mozilla|BreakBeforeBraces: Stroustrup|BreakBeforeBraces: Allman|BreakBeforeBraces: Whitesmiths|BreakBeforeBraces: GNU|BreakBeforeBraces: WebKit|BreakBeforeBraces: Custom" +ChoicesReadable="(Attach) Always attach braces to surrounding context.|(Linux) Like Attach, but break before braces on function, namespace and class definitions.|(Mozilla) Like Attach, but break before braces on enum, function, and record definitions.|(Stroustrup) Like Attach, but break before function definitions, catch, and else.|(Allman) Always break before braces.|(Whitesmiths) Like Allman but always indent braces and line up code with braces.|(GNU) Always break before braces and add an extra level of indentation to braces of control statements, not to those of class, function or other definitions.|(WebKit) Like Attach, but break before functions.|(Custom) Configure each individual brace in BraceWrapping." +ValueDefault=0 + +[BreakBeforeConceptDeclarations] +Category=1 +Description="(BreakBeforeConceptDeclarations) The concept declaration style to use." +EditorType=multiple +Enabled=false +Choices="BreakBeforeConceptDeclarations: Never|BreakBeforeConceptDeclarations: Allowed|BreakBeforeConceptDeclarations: Always" +ChoicesReadable="(Never) Keep the template declaration line together with `concept`.|(Allowed) Breaking between template declaration and `concept` is allowed. The actual behavior depends on the content and line breaking rules and penalties.|(Always) Always break before `concept`, putting it in the line after the template declaration." +ValueDefault=2 + +[BreakBeforeInlineASMColon] +Category=1 +Description="(BreakBeforeInlineASMColon) The inline ASM colon style to use." +EditorType=multiple +Enabled=false +Choices="BreakBeforeInlineASMColon: Never|BreakBeforeInlineASMColon: OnlyMultiline|BreakBeforeInlineASMColon: Always" +ChoicesReadable="(Never) No break before inline ASM colon.|(OnlyMultiline) Break before inline ASM colon if the line length is longer than column limit.|(Always) Always break before inline ASM colon." +ValueDefault=1 + +[BreakBeforeTernaryOperators] +Category=1 +Description="Ternary operators will be placed after line breaks.
true:
veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription
? firstValue
: SecondValueVeryVeryVeryVeryLong;

false:
veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription ?
firstValue :
SecondValueVeryVeryVeryVeryLong;
" +EditorType=boolean +TrueFalse="BreakBeforeTernaryOperators: true|BreakBeforeTernaryOperators: false" +Value=0 +ValueDefault=0 + +[BreakConstructorInitializers] +Category=1 +Description="(BreakConstructorInitializers) The break constructor initializers style to use." +EditorType=multiple +Enabled=false +Choices="BreakConstructorInitializers: BeforeColon|BreakConstructorInitializers: BeforeComma|BreakConstructorInitializers: AfterColon" +ChoicesReadable="(BeforeColon) Break constructor initializers before the colon and after the commas.|(BeforeComma) Break constructor initializers before the colon and commas, and align the commas with the colon.|(AfterColon) Break constructor initializers after the colon and commas." +ValueDefault=0 + +[BreakInheritanceList] +Category=1 +Description="(BreakInheritanceList) The inheritance list style to use." +EditorType=multiple +Enabled=false +Choices="BreakInheritanceList: BeforeColon|BreakInheritanceList: BeforeComma|BreakInheritanceList: AfterColon|BreakInheritanceList: AfterComma" +ChoicesReadable="(BeforeColon) Break inheritance list before the colon and after the commas.|(BeforeComma) Break inheritance list before the colon and commas, and align the commas with the colon.|(AfterColon) Break inheritance list after the colon and commas.|(AfterComma) Break inheritance list only after the commas." +ValueDefault=0 + +[BreakStringLiterals] +Category=1 +Description="Allow breaking string literals when formatting.
true:
const char* x = "veryVeryVeryVeryVeryVe"
"ryVeryVeryVeryVeryVery"
"VeryLongString";

false:
const char* x =
"veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongString";
" +EditorType=boolean +TrueFalse="BreakStringLiterals: true|BreakStringLiterals: false" +Value=1 +ValueDefault=1 + +[ColumnLimit] +Category=1 +Description="The column limit.

A column limit of 0 means that there is no column limit. In this case, clang-format will respect the input’s line breaking decisions within statements unless they contradict other rules." +EditorType=numeric +Enabled=false +CallName="ColumnLimit: " +MaxVal=2000 +MinVal=0 +Value=80 +ValueDefault=80 + +[CommentPragmas] +Category=1 +Description="A regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed.

// CommentPragmas: '^ FOOBAR pragma:'
// Will leave the following line unaffected
#include <vector> // FOOBAR pragma: keep
" +EditorType=string +CallName="CommentPragmas: " +Enabled=false +Value="'^ IWYU pragma:'" +ValueDefault="'^ IWYU pragma:'" + +[CompactNamespaces] +Category=1 +Description="If true, consecutive namespace declarations will be on the same line. If false, each namespace is declared on a new line.
true:
namespace Foo { namespace Bar {
}}

false:
namespace Foo {
namespace Bar {
}
}

If it does not fit on a single line, the overflowing namespaces get wrapped:

namespace Foo { namespace Bar {
namespace Extra {
}}}" +EditorType=boolean +TrueFalse="CompactNamespaces: true|CompactNamespaces: false" +Value=0 +ValueDefault=0 + +[ConstructorInitializerAllOnOneLineOrOnePerLine] +Category=1 +Description="This option is deprecated. See CurrentLine of PackConstructorInitializers." +EditorType=boolean +TrueFalse="ConstructorInitializerAllOnOneLineOrOnePerLine: true|ConstructorInitializerAllOnOneLineOrOnePerLine: false" +Value=0 +ValueDefault=0 + +[ConstructorInitializerIndentWidth] +Category=3 +Description="The number of characters to use for indentation of constructor initializer lists." +EditorType=numeric +Enabled=false +CallName="ConstructorInitializerIndentWidth: " +MaxVal=2000 +MinVal=0 +Value=4 +ValueDefault=4 + +[ContinuationIndentWidth] +Category=3 +Description="Indent width for line continuations.
ContinuationIndentWidth: 2

int i = // VeryVeryVeryVeryVeryLongComment
longFunction( // Again a long comment
arg);
" +EditorType=numeric +Enabled=false +CallName="ConstructorInitializerIndentWidth: " +MaxVal=2000 +MinVal=0 +Value=4 +ValueDefault=4 + +[Cpp11BracedListStyle] +Category=5 +Description="If true, format braced lists as best suited for C++11 braced lists.

Important differences:

Fundamentally, C++11 braced lists are formatted exactly like function calls would be formatted in their place. If the braced list follows a name (e.g. a type or variable name), clang-format formats as if the {} were the parentheses of a function call with that name. If there is no name, a zero-length name is assumed.

true:                                  false:
vector<int> x{1, 2, 3, 4}; vs. vector<int> x{ 1, 2, 3, 4 };
vector<T> x{{}, {}, {}, {}}; vector<T> x{ {}, {}, {}, {} };
f(MyMap[{composite, key}]); f(MyMap[{ composite, key }]);
new int[3]{1, 2, 3}; new int[3]{ 1, 2, 3 };
" +EditorType=boolean +TrueFalse="Cpp11BracedListStyle: true|Cpp11BracedListStyle: false" +Value=1 +ValueDefault=1 + +[DerivePointerAlignment] +Category=5 +Description="If true, analyze the formatted file for the most common alignment of & and *. Pointer and reference alignment styles are going to be updated according to the preferences found in the file. PointerAlignment is then used only as fallback." +EditorType=boolean +TrueFalse="DerivePointerAlignment: true|DerivePointerAlignment: false" +Value=0 +ValueDefault=0 + +[DisableFormat] +Category=0 +Description="Disables formatting completely." +EditorType=boolean +TrueFalse="DisableFormat: true|DisableFormat: false" +Value=0 +ValueDefault=0 + +[EmptyLineAfterAccessModifier] +Category=6 +Description="(EmptyLineAfterAccessModifier) Defines when to put an empty line after access modifiers. EmptyLineBeforeAccessModifier configuration handles the number of empty lines between two access modifiers." +EditorType=multiple +Enabled=false +Choices="EmptyLineAfterAccessModifier: Never|EmptyLineAfterAccessModifier: Leave|EmptyLineAfterAccessModifier: Always" +ChoicesReadable="(Never) Remove all empty lines after access modifiers.|(Leave) Keep existing empty lines after access modifiers. MaxEmptyLinesToKeep is applied instead.|(Always) Always add empty line after access modifiers if there are none. MaxEmptyLinesToKeep is applied also." +ValueDefault=0 + +[EmptyLineBeforeAccessModifier] +Category=6 +Description="(EmptyLineBeforeAccessModifier) Defines in which cases to put empty line before access modifiers." +EditorType=multiple +Enabled=false +Choices="EmptyLineBeforeAccessModifier: Never|EmptyLineBeforeAccessModifier: Leave|EmptyLineBeforeAccessModifier: LogicalBlock|EmptyLineBeforeAccessModifier: Always" +ChoicesReadable="(Never) Remove all empty lines before access modifiers.|(Leave) Keep existing empty lines before access modifiers.|(LogicalBlock) Add empty line only when access modifier starts a new logical block. Logical block is a group of one or more member fields or functions.|(Always) Always add empty line before access modifiers unless access modifier is at the start of struct or class definition." +ValueDefault=2 + +[FixNamespaceComments] +Category=7 +Description="If true, clang-format adds missing namespace end comments for namespaces and fixes invalid existing ones. This doesn't affect short namespaces, which are controlled by ShortNamespaceLines.
true:                                  false:
namespace longNamespace { vs. namespace longNamespace {
void foo(); void foo();
void bar(); void bar();
} // namespace a }
namespace shortNamespace { namespace shortNamespace {
void baz(); void baz();
} }
" +EditorType=boolean +TrueFalse="FixNamespaceComments: true|FixNamespaceComments: false" +Value=1 +ValueDefault=1 + +[ForEachMacros] +Category=7 +Description="A vector of macros that should be interpreted as foreach loops instead of as function calls.

These are expected to be macros of the form:

FOREACH(, ...)

In the .clang-format configuration file, this can be configured like:

ForEachMacros: ['RANGES_FOR', 'FOREACH']

For example: BOOST_FOREACH." +EditorType=string +CallName="ForEachMacros: " +Enabled=false +Value="['foreach', 'Q_FOREACH', 'BOOST_FOREACH']" +ValueDefault="['foreach', 'Q_FOREACH', 'BOOST_FOREACH']" + +[IfMacros] +Category=7 +Description="A vector of macros that should be interpreted as conditionals instead of as function calls.

These are expected to be macros of the form:

    IF(...)
<conditional-body>
else IF(...)
<conditional-body>
" +EditorType=string +CallName="IfMacros: " +Enabled=false +Value="['KJ_IF_MAYBE']" +ValueDefault="['KJ_IF_MAYBE']" + +[IncludeBlocks] +Category=7 +Description="(IncludeBlocks) Dependent on the value, multiple #include blocks can be sorted as one and divided based on category." +EditorType=multiple +Enabled=false +Choices="IncludeBlocks: Preserve|IncludeBlocks: Merge|IncludeBlocks: Regroup" +ChoicesReadable="(Preserve) Sort each #include block separately.|(Merge) Merge multiple #include blocks together and sort as one.|(Regroup) Merge multiple #include blocks together and sort as one. Then split into groups based on category priority. See IncludeCategories." +ValueDefault=0 + +[IncludeIsMainRegex] +Category=7 +Description="Specify a regular expression of suffixes that are allowed in the file-to-main-include mapping.

When guessing whether a #include is the “main” include, use this regex of allowed suffixes to the header stem. A partial match is done, so that: - “” means “arbitrary suffix” - “$” means “no suffix”.

For example, if configured to “(_test)?$”, then a header a.h would be seen as the “main” include in both a.cc and a_test.cc." +EditorType=string +CallName="IncludeIsMainRegex: " +Enabled=false +Value="''" +ValueDefault="''" + +[IncludeIsMainSourceRegex] +Category=7 +Description="Specify a regular expression for files being formatted that are allowed to be considered "main" in the file-to-main-include mapping.

By default, clang-format considers files as "main" only when they end with: .c, .cc, .cpp, .c++, .cxx, .m or .mm extensions. For these files a guessing of "main" include takes place (to assign category 0, see above). This config option allows for additional suffixes and extensions for files to be considered as "main".

For example, if this option is configured to (Impl\.hpp)$, then a file ClassImpl.hpp is considered "main" (in addition to Class.c, Class.cc, Class.cpp and so on) and "main include file" logic will be executed (with IncludeIsMainRegex setting also being respected in later phase). Without this option set, ClassImpl.hpp would not have the main include file put on top before any other include.

" +EditorType=string +CallName="IncludeIsMainSourceRegex: " +Enabled=false +Value="''" +ValueDefault="''" + +[IndentAccessModifiers] +Category=3 +Description="Specify whether access modifiers should have their own indentation level.

When false, access modifiers are indented (or outdented) relative to the record members, respecting the AccessModifierOffset. Record members are indented one level below the record.

When true, access modifiers get their own indentation level. As a consequence, record members are always indented 2 levels below the record, regardless of the access modifier presence. Value of the AccessModifierOffset is ignored.

     false:                                 true:
class C { vs. class C {
class D { class D {
void bar(); void bar();
protected: protected:
D(); D();
}; };
public: public:
C(); C();
}; };
void foo() { void foo() {
return 1; return 1;
} }
" +EditorType=boolean +TrueFalse="IndentAccessModifiers: true|IndentAccessModifiers: false" +Value=0 +ValueDefault=0 + +[IndentCaseBlocks] +Category=3 +Description="Indent case label blocks one level from the case label.

When false, the block following the case label uses the same indentation level as for the case label, treating the case label the same as an if-statement. When true, the block gets indented as a scope block.

false:                                 true:
switch (fool) { vs. switch (fool) {
case 1: { case 1:
bar(); {
} break; bar();
default: { }
plop(); break;
} default:
} {
plop();
}
}
" +EditorType=boolean +TrueFalse="IndentCaseBlocks: true|IndentCaseBlocks: false" +Value=0 +ValueDefault=0 + +[IndentCaseLabels] +Category=3 +Description="Indent case labels one level from the switch statement.

When false, use the same indentation level as for the switch statement. Switch statement body is always indented one level more than case labels (except the first block following the case label, which itself indents the code - unless IndentCaseBlocks is enabled).

false:                                 true:
switch (fool) { vs. switch (fool) {
case 1: case 1:
bar(); bar();
break; break;
default: default:
plop(); plop();
} }
" +EditorType=boolean +TrueFalse="IndentCaseLabels: true|IndentCaseLabels: false" +Value=0 +ValueDefault=0 + +[IndentExternBlock] +Category=3 +Description="(IndentExternBlock) The type of indenting of extern blocks." +EditorType=multiple +Enabled=false +Choices="IndentExternBlock: AfterExternBlock|IndentExternBlock: NoIndent|IndentExternBlock: Indent" +ChoicesReadable="(AfterExternBlock) Backwards compatible with AfterExternBlock’s indenting.|(NoIndent) Does not indent extern blocks.|(Indent) Indents extern blocks." +ValueDefault=0 + +[IndentGotoLabels] +Category=3 +Description="Indent goto labels.

When false, goto labels are flushed left.

true:                                  false:
int f() { vs. int f() {
if (foo()) { if (foo()) {
label1: label1:
bar(); bar();
} }
label2: label2:
return 1; return 1;
} }
" +EditorType=boolean +TrueFalse="IndentGotoLabels: true|IndentGotoLabels: false" +Value=1 +ValueDefault=1 + +[IndentPPDirectives] +Category=3 +Description="(IndentPPDirectives) The preprocessor directive indenting style to use." +EditorType=multiple +Enabled=false +Choices="IndentPPDirectives: None|IndentPPDirectives: AfterHash|IndentPPDirectives: BeforeHash" +ChoicesReadable="(None) Does not indent any directives.|(AfterHash) Indents directives after the hash.|(BeforeHash) Indents directives before the hash." +ValueDefault=0 + +[IndentRequiresClause] +Category=3 +Description="Indent the requires clause in a template. This only applies when RequiresClausePosition is OwnLine, or WithFollowing.

In clang-format 12, 13 and 14 it was named IndentRequires.

true:
template <typename It>
requires Iterator<It>
void sort(It begin, It end) {
//....
}

false:
template <typename It>
requires Iterator<It>
void sort(It begin, It end) {
//....
}
" +EditorType=boolean +TrueFalse="IndentRequiresClause: true|IndentRequiresClause: false" +Value=1 +ValueDefault=1 + +[IndentWidth] +Category=3 +Description="The number of columns to use for indentation.
IndentWidth: 3

void f() {
someFunction();
if (true, false) {
f();
}
}
" +EditorType=numeric +Enabled=false +CallName="IndentWidth: " +MaxVal=1000 +MinVal=0 +Value=2 +ValueDefault=2 + +[IndentWrappedFunctionNames] +Category=3 +Description="Indent if a function definition or declaration is wrapped after the type.
true:
LoooooooooooooooooooooooooooooooooooooooongReturnType
LoooooooooooooooooooooooooooooooongFunctionDeclaration();

false:
LoooooooooooooooooooooooooooooooooooooooongReturnType
LoooooooooooooooooooooooooooooooongFunctionDeclaration();
" +EditorType=boolean +TrueFalse="IndentWrappedFunctionNames: true|IndentWrappedFunctionNames: false" +Value=0 +ValueDefault=0 + +[InsertBraces] +Category=7 +Description="Insert braces after control statements (if, else, for, do, and while) in C++ unless the control statements are inside macro definitions or the braces would enclose preprocessor directives.

Warning
Setting this option to true could lead to incorrect code formatting due to clang-format's lack of complete semantic information. As such, extra care should be taken to review code changes made by this option.

false:                                    true:

if (isa<FunctionDecl>(D)) vs. if (isa<FunctionDecl>(D)) {
handleFunctionDecl(D); handleFunctionDecl(D);
else if (isa<VarDecl>(D)) } else if (isa<VarDecl>(D)) {
handleVarDecl(D); handleVarDecl(D);
else } else {
return; return;
}

while (i--) vs. while (i--) {
for (auto *A : D.attrs()) for (auto *A : D.attrs()) {
handleAttr(A); handleAttr(A);
}
}

do vs. do {
--i; --i;
while (i); } while (i);
" +EditorType=boolean +TrueFalse="InsertBraces: true|InsertBraces: false" +Value=0 +ValueDefault=0 + +[InsertNewlineAtEOF] +Category=7 +Description="Insert a newline at end of file if missing." +EditorType=boolean +TrueFalse="InsertNewlineAtEOF: true|InsertNewlineAtEOF: false" +Value=0 +ValueDefault=0 + +[InsertTrailingCommas] +Category=7 +Description="(InsertTrailingCommas) If set to Wrapped will insert trailing commas in container literals (arrays and objects) that wrap across multiple lines. It is currently only available for JavaScript and disabled by default. Cannot be used together with BinPackArguments as inserting the comma disables bin-packing.
Wrapped:
const someArray = [
aaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaa,
// ^ inserted
]
" +EditorType=multiple +Enabled=false +Choices="InsertTrailingCommas: None|InsertTrailingCommas: Wrapped" +ChoicesReadable="(None) Do not insert trailing commas.|(Wrapped) Insert trailing commas in container literals that were wrapped over multiple lines." +ValueDefault=0 + +[IntegerLiteralSeparator] +Category=7 +Description="Format integer literal separators (' for C++ and _ for C#, Java, and JavaScript).

Nested configuration flags:

Separator format of integer literals of different bases.

If negative, remove separators. If 0, leave the literal as is. If positive, insert separators between digits starting from the rightmost digit.

For example, the config below will leave separators in binary literals alone, insert separators in decimal literals to separate the digits into groups of 3, and remove separators in hexadecimal literals.

IntegerLiteralSeparator:
Binary: 0
Decimal: 3
Hex: -1

You can also specify a minimum number of digits (BinaryMinDigits, DecimalMinDigits, and HexMinDigits) the integer literal must have in order for the separators to be inserted.

" +EditorType=boolean +TrueFalse="IntegerLiteralSeparator:|IntegerLiteralSeparator:" +Value=1 +ValueDefault=1 + +[ - Binary] +Category=7 +Description="Format separators in binary literals." +EditorType=numeric +Enabled=false +CallName=" Binary: " +MaxVal=255 +MinVal=-256 +Value=0 +ValueDefault=0 + +[ - BinaryMinDigits] +Category=7 +Description="Format separators in binary literals with a minimum number of digits.
// Binary: 3
// BinaryMinDigits: 7
b1 = 0b101101;
b2 = 0b1'101'101;
" +EditorType=numeric +Enabled=false +CallName=" BinaryMinDigits: " +MaxVal=255 +MinVal=-256 +Value=0 +ValueDefault=0 + +[ - Decimal] +Category=7 +Description="Format separators in decimal literals." +EditorType=numeric +Enabled=false +CallName=" Decimal: " +MaxVal=255 +MinVal=-256 +Value=0 +ValueDefault=0 + +[ - DecimalMinDigits] +Category=7 +Description="Format separators in decimal literals with a minimum number of digits.
// Decimal: 3
// DecimalMinDigits: 5
d1 = 2023;
d2 = 10'000;
" +EditorType=numeric +Enabled=false +CallName=" DecimalMinDigits: " +MaxVal=255 +MinVal=-256 +Value=0 +ValueDefault=0 + +[ - Hex] +Category=7 +Description="Format separators in hexadecimal literals." +EditorType=numeric +Enabled=false +CallName=" Hex: " +MaxVal=255 +MinVal=-256 +Value=0 +ValueDefault=0 + +[ - HexMinDigits] +Category=7 +Description="Format separators in hexadecimal literals with a minimum number of digits.
// Hex: 2
// HexMinDigits: 6
h1 = 0xABCDE;
h2 = 0xAB'CD'EF;
" +EditorType=numeric +Enabled=false +CallName=" HexMinDigits: " +MaxVal=255 +MinVal=-256 +Value=0 +ValueDefault=0 + +[JavaImportGroups] +Category=7 +Description="

A vector of prefixes ordered by the desired groups for Java imports.

One group’s prefix can be a subset of another - the longest prefix is always matched. Within a group, the imports are ordered lexicographically. Static imports are grouped separately and follow the same group rules. By default, static imports are placed before non-static imports, but this behavior is changed by another option, SortJavaStaticImport.

In the .clang-format configuration file, this can be configured like in the following yaml example.

JavaImportGroups: ['com.example', 'com', 'org']

This will result in imports being formatted as in the Java example below.

import static com.example.function1;

import static com.test.function2;

import static org.example.function3;

import com.example.ClassA;
import com.example.Test;
import com.example.a.ClassB;

import com.test.ClassC;

import org.example.ClassD;
" +EditorType=string +CallName="JavaImportGroups: " +Enabled=false +Value="[]" +ValueDefault="[]" + +[JavaScriptQuotes] +Category=7 +Description="(JavaScriptQuotes) The quote style to use for JavaScript strings." +EditorType=multiple +Enabled=false +Choices="JavaScriptQuotes: Leave|JavaScriptQuotes: Single|JavaScriptQuotes: Double" +ChoicesReadable="(Leave) Leave string quotes as they are.|(Single) Always use single quotes.|(Double) Always use double quotes." +ValueDefault=0 + +[JavaScriptWrapImports] +Category=1 +Description="Whether to wrap JavaScript import/export statements.
true:
import {
VeryLongImportsAreAnnoying,
VeryLongImportsAreAnnoying,
VeryLongImportsAreAnnoying,
} from 'some/module.js'

false:
import {VeryLongImportsAreAnnoying, VeryLongImportsAreAnnoying, VeryLongImportsAreAnnoying,} from "some/module.js"
" +EditorType=boolean +TrueFalse="JavaScriptWrapImports: true|JavaScriptWrapImports: false" +Value=0 +ValueDefault=0 + +[KeepEmptyLinesAtEOF] +Category=6 +Description="Keep empty lines (up to MaxEmptyLinesToKeep) at end of file." +EditorType=boolean +TrueFalse="KeepEmptyLinesAtEOF: true|KeepEmptyLinesAtEOF: false" +Value=0 +ValueDefault=0 + +[KeepEmptyLinesAtTheStartOfBlocks] +Category=6 +Description="If true, the empty line at the start of blocks is kept.
true:                                  false:
if (foo) { vs. if (foo) {
bar();
bar(); }
}
" +EditorType=boolean +TrueFalse="KeepEmptyLinesAtTheStartOfBlocks: true|KeepEmptyLinesAtTheStartOfBlocks: false" +Value=0 +ValueDefault=0 + +[LambdaBodyIndentation] +Category=3 +Description="(LambdaBodyIndentation) The indentation style of lambda bodies." +EditorType=multiple +Enabled=false +Choices="LambdaBodyIndentation: Signature|LambdaBodyIndentation: OuterScope" +ChoicesReadable="(Signature) Align lambda body relative to the lambda signature. This is the default.|(OuterScope) Align lambda body relative to the indentation level of the outer scope the lambda signature resides in." +ValueDefault=0 + +[LineEnding] +Category=7 +Description="(LineEnding) Line ending style (\n or \r\n) to use." +EditorType=multiple +Enabled=false +Choices="LineEnding: LF|LineEnding: CRLF|LineEnding: DeriveLF|LineEnding: DeriveCRLF" +ChoicesReadable="(LF) Use \n.|(CRLF) Use \r\n.|(DeriveLF) Use \n unless the input has more lines ending in \r\n.|(DeriveCRLF) Use \r\n unless the input has more lines ending in \n." +ValueDefault=2 + +[MacroBlockBegin] +Category=3 +Description="A regular expression matching macros that start a block." +EditorType=string +CallName="MacroBlockBegin: " +Enabled=false +Value="''" +ValueDefault="''" + +[MacroBlockEnd] +Category=3 +Description="A regular expression matching macros that end a block." +EditorType=string +CallName="MacroBlockEnd: " +Enabled=false +Value="''" +ValueDefault="''" + +[Macros] +Category=7 +Description="A list of macros of the form <definition>=<expansion>.

Code will be parsed with macros expanded, in order to determine how to interpret and format the macro arguments.

For example, the code:

A(a*b);
will usually be interpreted as a call to a function A, and the multiplication expression will be formatted as a * b.

If we specify the macro definition:

Macros:
- A(x)=x
the code will now be parsed as a declaration of the variable b of type a*, and formatted as a* b (depending on pointer-binding rules).

Features and restrictions:

" +EditorType=string +CallName="Macros: " +Enabled=false +Value="[]" +ValueDefault="[]" + +[MaxEmptyLinesToKeep] +Category=6 +Description="The maximum number of consecutive empty lines to keep.
MaxEmptyLinesToKeep: 1 vs. MaxEmptyLinesToKeep: 0
int f() { int f() {
int = 1; int i = 1;
i = foo();
i = foo(); return i;
}
return i;
}" +EditorType=numeric +Enabled=false +CallName="MaxEmptyLinesToKeep: " +MaxVal=1000 +MinVal=0 +Value=1 +ValueDefault=1 + +[NamespaceIndentation] +Category=3 +Description="(NamespaceIndentation) The indentation used for namespaces." +EditorType=multiple +Enabled=false +Choices="NamespaceIndentation: None|NamespaceIndentation: Inner|NamespaceIndentation: All" +ChoicesReadable="(None) Don’t indent in namespaces.|(Inner) Indent only in inner namespaces (nested in other namespaces).|(All) Indent in all namespaces." +ValueDefault=0 + +[NamespaceMacros] +Category=7 +Description="A vector of macros which are used to open namespace blocks.

These are expected to be macros of the form:

NAMESPACE(<namespace-name>, ...) {
<namespace-content>
}

For example: TESTSUITE" +EditorType=string +CallName="NamespaceMacros: " +Enabled=false +Value="[]" +ValueDefault="[]" + +[ObjCBinPackProtocolList] +Category=1 +Description="(ObjCBinPackProtocolList) Controls bin-packing Objective-C protocol conformance list items into as few lines as possible when they go over ColumnLimit.

If Auto (the default), delegates to the value in BinPackParameters. If that is true, bin-packs Objective-C protocol conformance list items into as few lines as possible whenever they go over ColumnLimit.

If Always, always bin-packs Objective-C protocol conformance list items into as few lines as possible whenever they go over ColumnLimit.

If Never, lays out Objective-C protocol conformance list items onto individual lines whenever they go over ColumnLimit.

Always (or Auto, if BinPackParameters=true):
@interface ccccccccccccc () <
ccccccccccccc, ccccccccccccc,
ccccccccccccc, ccccccccccccc> {
}

Never (or Auto, if BinPackParameters=false):
@interface ddddddddddddd () <
ddddddddddddd,
ddddddddddddd,
ddddddddddddd,
ddddddddddddd> {
}
" +EditorType=multiple +Enabled=false +Choices="ObjCBinPackProtocolList: Auto|ObjCBinPackProtocolList: Always|ObjCBinPackProtocolList: Never" +ChoicesReadable="(Auto) Automatically determine parameter bin-packing behavior.|(Always) Always bin-pack parameters.|(Never) Never bin-pack parameters." +ValueDefault=0 + +[ObjCBlockIndentWidth] +Category=3 +Description="The number of characters to use for indentation of ObjC blocks.
ObjCBlockIndentWidth: 4

[operation setCompletionBlock:^{
[self onOperationDone];
}];
" +EditorType=numeric +Enabled=false +CallName="ObjCBlockIndentWidth: " +MaxVal=1000 +MinVal=0 +Value=2 +ValueDefault=2 + +[ObjCBreakBeforeNestedBlockParam] +Category=1 +Description="Break parameters list into lines when there is nested block parameters in a function call.
false:
- (void)_aMethod
{
[self.test1 t:self w:self callback:^(typeof(self) self, NSNumber
*u, NSNumber *v) {
u = c;
}]
}
true:
- (void)_aMethod
{
[self.test1 t:self
w:self
callback:^(typeof(self) self, NSNumber *u, NSNumber *v) {
u = c;
}]
}
" +EditorType=boolean +TrueFalse="ObjCBreakBeforeNestedBlockParam: true|ObjCBreakBeforeNestedBlockParam: false" +Value=1 +ValueDefault=1 + +[ObjCSpaceAfterProperty] +Category=5 +Description="Add a space after @property in Objective-C, i.e. use @property (readonly) instead of @property(readonly)." +EditorType=boolean +TrueFalse="ObjCSpaceAfterProperty: true|ObjCSpaceAfterProperty: false" +Value=0 +ValueDefault=0 + +[ObjCSpaceBeforeProtocolList] +Category=5 +Description="Add a space in front of an Objective-C protocol list, i.e. use Foo <Protocol> instead of Foo<Protocol>." +EditorType=boolean +TrueFalse="ObjCSpaceBeforeProtocolList: true|ObjCSpaceBeforeProtocolList: false" +Value=0 +ValueDefault=0 + +[PackConstructorInitializers] +Category=1 +Description="(PackConstructorInitializers) The pack constructor initializers style to use." +EditorType=multiple +Enabled=false +Choices="PackConstructorInitializers: Never|PackConstructorInitializers: BinPack|PackConstructorInitializers: CurrentLine|PackConstructorInitializers: NextLine|PackConstructorInitializers: NextLineOnly" +ChoicesReadable="(Never) Always put each constructor initializer on its own line.|(BinPack) Bin-pack constructor initializers.|(CurrentLine) Put all constructor initializers on the current line if they fit. Otherwise, put each one on its own line.|(NextLine) Same as CurrentLine except that if all constructor initializers do not fit on the current line, try to fit them on the next line.|(NextLineOnly) Put all constructor initializers on the next line if they fit. Otherwise, put each one on its own line." +ValueDefault=1 + +[PenaltyBreakAssignment] +Category=1 +Description="The penalty for breaking around an assignment operator." +EditorType=numeric +Enabled=false +CallName="PenaltyBreakAssignment: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyBreakBeforeFirstCallParameter] +Category=1 +Description="The penalty for breaking a function call after call(." +EditorType=numeric +Enabled=false +CallName="PenaltyBreakBeforeFirstCallParameter: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyBreakComment] +Category=1 +Description="The penalty for each line break introduced inside a comment." +EditorType=numeric +Enabled=false +CallName="PenaltyBreakComment: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyBreakFirstLessLess] +Category=1 +Description="The penalty for breaking before the first <<." +EditorType=numeric +Enabled=false +CallName="PenaltyBreakFirstLessLess: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyBreakOpenParenthesis] +Category=1 +Description="The penalty for breaking after (." +EditorType=numeric +Enabled=false +CallName="PenaltyBreakOpenParenthesis: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyBreakString] +Category=1 +Description="The penalty for each line break introduced inside a string literal." +EditorType=numeric +Enabled=false +CallName="PenaltyBreakString: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyBreakTemplateDeclaration] +Category=1 +Description="The penalty for breaking after template declaration." +EditorType=numeric +Enabled=false +CallName="PenaltyBreakTemplateDeclaration: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyExcessCharacter] +Category=1 +Description="The penalty for each character outside of the column limit." +EditorType=numeric +Enabled=false +CallName="PenaltyExcessCharacter: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyIndentedWhitespace] +Category=1 +Description="Penalty for each character of whitespace indentation (counted relative to leading non-whitespace column)." +EditorType=numeric +Enabled=false +CallName="PenaltyIndentedWhitespace: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PenaltyReturnTypeOnItsOwnLine] +Category=1 +Description="Penalty for putting the return type of a function onto its own line." +EditorType=numeric +Enabled=false +CallName="PenaltyReturnTypeOnItsOwnLine: " +MaxVal=10000000 +MinVal=0 +Value=0 +ValueDefault=0 + +[PointerAlignment] +Category=5 +Description="(PointerAlignment) Pointer and reference alignment style." +EditorType=multiple +Enabled=false +Choices="PointerAlignment: Left|PointerAlignment: Middle|PointerAlignment: Right" +ChoicesReadable="(Left) Align pointer to the left.|(Middle) Align pointer in the middle.|(Right) Align pointer to the right." +ValueDefault=2 + +[PPIndentWidth] +Category=3 +Description="The number of columns to use for indentation of preprocessor statements. When set to -1 (default) IndentWidth is used also for preprocessor statements.
     PPIndentWidth: 1

#ifdef __linux__
# define FOO
#else
# define BAR
#endif
" +EditorType=numeric +Enabled=false +CallName="PPIndentWidth: " +MaxVal=10000000 +MinVal=-1 +Value=-1 +ValueDefault=-1 + +[QualifierAlignment] +Category=7 +Description="(QualifierAlignment) Different ways to arrange specifiers and qualifiers (e.g. const/volatile).

WARNING: Setting QualifierAlignment to something other than Leave, COULD lead to incorrect code formatting due to incorrect decisions made due to clang-formats lack of complete semantic information. As such extra care should be taken to review code changes made by the use of this option.

" +EditorType=multiple +Enabled=false +Choices="QualifierAlignment: Leave|QualifierAlignment: Left|QualifierAlignment: Right|QualifierAlignment: Custom" +ChoicesReadable="(Leave) Don't change specifiers/qualifiers to either Left or Right alignment.|(Left) Change specifiers/qualifiers to be left-aligned.|(Right) Change specifiers/qualifiers to be right-aligned.|(Custom) Change specifiers/qualifiers to be aligned based on QualifierOrder." +ValueDefault=0 + +[QualifierOrder] +Category=7 +Description="The order in which the qualifiers appear.

Order is an array that can contain any of the following:

Note
it MUST contain 'type'.

Items to the left of 'type' will be placed to the left of the type and aligned in the order supplied. Items to the right of 'type' will be placed to the right of the type and aligned in the order supplied.

" +EditorType=string +CallName="QualifierOrder: " +Enabled=false +Value="['type']" +ValueDefault="['type']" + +[ReferenceAlignment] +Category=4 +Description="(ReferenceAlignment) Reference alignment style (overrides PointerAlignment for references)." +EditorType=multiple +Enabled=false +Choices="ReferenceAlignment: Pointer|ReferenceAlignment: Left|ReferenceAlignment: Right|ReferenceAlignment: Middle" +ChoicesReadable="(Pointer) Align reference like PointerAlignment.|(Left) Align reference to the left.|(Right) Align reference to the right.|(Middle) Align reference in the middle." +ValueDefault=0 + +[ReflowComments] +Category=1 +Description="If true, clang-format will attempt to re-flow comments. That is it will touch a comment and *reflow* long comments into new lines, trying to obey the ColumnLimit.
false:
// veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information
/* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */

true:
// veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
// information
/* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
* information */
" +EditorType=boolean +TrueFalse="ReflowComments: true|ReflowComments: false" +Value=1 +ValueDefault=1 + +[RemoveBracesLLVM] +Category=7 +Description="Remove optional braces of control statements (if, else, for, and while) in C++ according to the LLVM coding style.

Warning
This option will be renamed and expanded to support other styles.

Warning
Setting this option to true could lead to incorrect code formatting due to clang-format's lack of complete semantic information. As such, extra care should be taken to review code changes made by this option.

false:                                     true:

if (isa<FunctionDecl>(D)) { vs. if (isa<FunctionDecl>(D))
handleFunctionDecl(D); handleFunctionDecl(D);
} else if (isa<VarDecl>(D)) { else if (isa<VarDecl>(D))
handleVarDecl(D); handleVarDecl(D);
}

if (isa<VarDecl>(D)) { vs. if (isa<VarDecl>(D)) {
for (auto *A : D.attrs()) { for (auto *A : D.attrs())
if (shouldProcessAttr(A)) { if (shouldProcessAttr(A))
handleAttr(A); handleAttr(A);
} }
}
}

if (isa<FunctionDecl>(D)) { vs. if (isa<FunctionDecl>(D))
for (auto *A : D.attrs()) { for (auto *A : D.attrs())
handleAttr(A); handleAttr(A);
}
}

if (auto *D = (T)(D)) { vs. if (auto *D = (T)(D)) {
if (shouldProcess(D)) { if (shouldProcess(D))
handleVarDecl(D); handleVarDecl(D);
} else { else
markAsIgnored(D); markAsIgnored(D);
} }
}

if (a) { vs. if (a)
b(); b();
} else { else if (c)
if (c) { d();
d(); else
} else { e();
e();
}
}
" +EditorType=boolean +TrueFalse="RemoveBracesLLVM: true|RemoveBracesLLVM: false" +Value=0 +ValueDefault=0 + +[RemoveParentheses] +Category=7 +Description="(RemoveParentheses) Remove redundant parentheses.

Warning
Setting this option to any value other than Leave could lead to incorrect code formatting due to clang-format's lack of complete semantic information. As such, extra care should be taken to review code changes made by this option.

" +EditorType=multiple +Enabled=false +Choices="RemoveParentheses: Leave|RemoveParentheses: MultipleParentheses|RemoveParentheses: ReturnStatement" +ChoicesReadable="(Leave) Do not remove parentheses.|(MultipleParentheses) Replace multiple parentheses with single parentheses.|(ReturnStatement) Also remove parentheses enclosing the expression in a return/co_return statement." +ValueDefault=0 + +[RemoveSemicolon] +Category=7 +Description="Remove semicolons after the closing brace of a non-empty function.

Warning

Setting this option to true could lead to incorrect code formatting due to clang-format's lack of complete semantic information. As such, extra care should be taken to review code changes made by this option.
false:                                     true:

int max(int a, int b) { int max(int a, int b) {
return a > b ? a : b; return a > b ? a : b;
}; }
" +EditorType=boolean +TrueFalse="RemoveSemicolon: true|RemoveSemicolon: false" +Value=0 +ValueDefault=0 + +[RequiresClausePosition] +Category=1 +Description="(RequiresClausePosition) " +EditorType=multiple +Enabled=false +Choices="RequiresClausePosition: OwnLine|RequiresClausePosition: WithPreceding|RequiresClausePosition: WithFollowing|RequiresClausePosition: SingleLine" +ChoicesReadable="(OwnLine) Always put the `requires` clause on its own line.|(WithPreceding) Try to put the clause together with the preceding part of a declaration. For class templates: stick to the template declaration. For function templates: stick to the template declaration. For function declaration followed by a requires clause: stick to the parameter list.|(WithFollowing) Try to put the `requires` clause together with the class or function declaration.|(SingleLine) Try to put everything in the same line if possible. Otherwise normal line breaking rules take over." +ValueDefault=0 + +[RequiresExpressionIndentation] +Category=3 +Description="(RequiresExpressionIndentation) The indentation used for requires expression bodies." +EditorType=multiple +Enabled=false +Choices="RequiresExpressionIndentation: OuterScope|RequiresExpressionIndentation: Keyword" +ChoicesReadable="(OuterScope) Align requires expression body relative to the indentation level of the outer scope the requires expression resides in. This is the default.|(Keyword) Align requires expression body relative to the requires keyword." +ValueDefault=0 + +[SeparateDefinitionBlocks] +Category=6 +Description="(SeparateDefinitionBlocks) Specifies the use of empty lines to separate definition blocks, including classes, structs, enums, and functions.
Never                  v.s.     Always
#include <cstring> #include <cstring>
struct Foo {
int a, b, c; struct Foo {
}; int a, b, c;
namespace Ns { };
class Bar {
public: namespace Ns {
struct Foobar { class Bar {
int a; public:
int b; struct Foobar {
}; int a;
private: int b;
int t; };
int method1() {
// ... private:
} int t;
enum List {
ITEM1, int method1() {
ITEM2 // ...
}; }
template
int method2(T x) { enum List {
// ... ITEM1,
} ITEM2
int i, j, k; };
int method3(int par) {
// ... template
} int method2(T x) {
}; // ...
class C {}; }
}
int i, j, k;

int method3(int par) {
// ...
}
};

class C {};
}
" +EditorType=multiple +Enabled=false +Choices="SeparateDefinitionBlocks: Leave|SeparateDefinitionBlocks: Always|SeparateDefinitionBlocks: Never" +ChoicesReadable="(Leave) Leave definition blocks as they are.|(Always) Insert an empty line between definition blocks.|(Never) Remove any empty line between definition blocks." +ValueDefault=0 + +[ShortNamespaceLines] +Category=7 +Description="The maximal number of unwrapped lines that a short namespace spans. Defaults to 1.

This determines the maximum length of short namespaces by counting unwrapped lines (i.e. containing neither opening nor closing namespace brace) and makes FixNamespaceComments omit adding end comments for those.

     ShortNamespaceLines: 1     vs.     ShortNamespaceLines: 0
namespace a { namespace a {
int foo; int foo; + } } // namespace a

ShortNamespaceLines: 1 vs. ShortNamespaceLines: 0
namespace b { namespace b {
int foo; int foo;
int bar; int bar;
} // namespace b } // namespace b
" +EditorType=numeric +Enabled=false +CallName="ShortNamespaceLines: " +MaxVal=10000000 +MinVal=0 +Value=1 +ValueDefault=1 + +[SortIncludes] +Category=7 +Description="(SortIncludes) Controls if and how clang-format will sort #includes." +EditorType=multiple +Enabled=false +Choices="SortIncludes: Never|SortIncludes: CaseSensitive|SortIncludes: CaseInsensitive" +ChoicesReadable="(Never) Includes are never sorted.|(CaseSensitive) Includes are sorted in an ASCIIbetical or case sensitive fashion.|(CaseInsensitive) Includes are sorted in an alphabetical or case insensitive fashion." +ValueDefault=1 + +[SortJavaStaticImport] +Category=7 +Description="(SortJavaStaticImport) When sorting Java imports, by default static imports are placed before non-static imports. If JavaStaticImportAfterImport is After, static imports are placed after non-static imports." +EditorType=multiple +Enabled=false +Choices="SortJavaStaticImport: Before|SortJavaStaticImport: After" +ChoicesReadable="(Before) Static imports are placed before non-static imports.|(After) Static imports are placed after non-static imports." +ValueDefault=0 + +[SortUsingDeclarations] +Category=7 +Descriptions="(SortUsingDeclarations) Controls if and how clang-format will sort using declarations." +EditorType=multiple +Enabled=false +Choices="SortUsingDeclarations: Never|SortUsingDeclarations: Lexicographic|SortUsingDeclarations: LexicographicNumeric" +ChoicesReadable="(Never) Using declarations are never sorted.|(Lexicographic) Using declarations are sorted in the order defined as follows: Split the strings by '::' and discard any initial empty strings. Sort the lists of names lexicographically, and within those groups, names are in case-insensitive lexicographic order.|(LexicographicNumeric) Using declarations are sorted in the order defined as follows: Split the strings by '::' and discard any initial empty strings. The last element of each list is a non-namespace name; all others are namespace names. Sort the lists of names lexicographically, where the sort order of individual names is that all non-namespace names come before all namespace names, and within those groups, names are in case-insensitive lexicographic order." +ValueDefault=2 + +[SpaceAfterCStyleCast] +Category=5 +Description="If true, a space is inserted after C style casts.
true:                                  false:
(int) i; vs. (int)i;
" +EditorType=boolean +TrueFalse="SpaceAfterCStyleCast: true|SpaceAfterCStyleCast: false" +Value=0 +ValueDefault=0 + +[SpaceAfterLogicalNot] +Category=5 +Description="If true, a space is inserted after the logical not operator (!).
true:                                  false:
! someExpression(); vs. !someExpression();
" +EditorType=boolean +TrueFalse="SpaceAfterLogicalNot: true|SpaceAfterLogicalNot: false" +Value=0 +ValueDefault=0 + +[SpaceAfterTemplateKeyword] +Category=5 +Description="If true, a space will be inserted after the ‘template’ keyword.
true:                                  false:
template <int> void foo(); vs. template<int> void foo();
" +EditorType=boolean +TrueFalse="SpaceAfterTemplateKeyword: true|SpaceAfterTemplateKeyword: false" +Value=1 +ValueDefault=1 + +[SpaceAroundPointerQualifiers] +Category=5 +Description="(SpaceAroundPointerQualifiers) Defines in which cases to put a space before or after pointer qualifiers" +EditorType=multiple +Enabled=false +Choices="SpaceAroundPointerQualifiers: Default|SpaceAroundPointerQualifiers: Before|SpaceAroundPointerQualifiers: After|SpaceAroundPointerQualifiers: Both" +ChoicesReadable="(Default) Don't ensure spaces around pointer qualifiers and use PointerAlignment instead.|(Before) Ensure that there is a space before pointer qualifiers.|(After) Ensure that there is a space after pointer qualifiers.|(Both) Ensure that there is a space both before and after pointer qualifiers." +ValueDefault=0 + +[SpaceBeforeAssignmentOperators] +Category=5 +Description="If false, spaces will be removed before assignment operators.
true:                                  false:
int a = 5; vs. int a= 5;
a += 42; a+= 42;
" +EditorType=boolean +TrueFalse="SpaceBeforeAssignmentOperators: true|SpaceBeforeAssignmentOperators: false" +Value=1 +ValueDefault=1 + +[SpaceBeforeCaseColon] +Category=5 +Description="If false, spaces will be removed before case colon.
true:                                   false
switch (x) { vs. switch (x) {
case 1 : break; case 1: break;
} }
" +EditorType=boolean +TrueFalse="SpaceBeforeCaseColon: true|SpaceBeforeCaseColon: false" +Value=0 +ValueDefault=0 + +[SpaceBeforeCpp11BracedList] +Category=5 +Description="If true, a space will be inserted before a C++11 braced list used to initialize an object (after the preceding identifier or type).
true:                                  false:
Foo foo { bar }; vs. Foo foo{ bar };
Foo {}; Foo{};
vector { 1, 2, 3 }; vector{ 1, 2, 3 };
new int[3] { 1, 2, 3 }; new int[3]{ 1, 2, 3 };
" +EditorType=boolean +TrueFalse="SpaceBeforeCpp11BracedList: true|SpaceBeforeCpp11BracedList: false" +Value=1 +ValueDefault=1 + +[SpaceBeforeCtorInitializerColon] +Category=5 +Description="If false, spaces will be removed before constructor initializer colon.
true:                                  false:
Foo::Foo() : a(a) {} Foo::Foo(): a(a) {}
" +EditorType=boolean +TrueFalse="SpaceBeforeCtorInitializerColon: true|SpaceBeforeCtorInitializerColon: false" +Value=1 +ValueDefault=1 + +[SpaceBeforeInheritanceColon] +Category=5 +Description="If false, spaces will be removed before inheritance colon.
true:                                  false:
class Foo : Bar {} vs. class Foo: Bar {}
" +EditorType=boolean +TrueFalse="SpaceBeforeInheritanceColon: true|SpaceBeforeInheritanceColon: false" +Value=1 +ValueDefault=1 + +[SpaceBeforeJsonColon] +Category=5 +Description="If true, a space will be add before a JSON colon. For other languages, e.g. JavaScript, use SpacesInContainerLiterals instead.
true:                                  false:
{ {
"key" : "value" vs. "key": "value"
} }
" +EditorType=boolean +TrueFalse="SpaceBeforeJsonColon: true|SpaceBeforeJsonColon: false" +Value=0 +ValueDefault=0 + +[SpaceBeforeParens] +Category=5 +Description="(SpaceBeforeParens) Defines in which cases to put a space before opening parentheses." +EditorType=multiple +Enabled=false +Choices="SpaceBeforeParens: Never|SpaceBeforeParens: ControlStatements|SpaceBeforeParens: ControlStatementsExceptForEachMacros|SpaceBeforeParens: NonEmptyParentheses|SpaceBeforeParens: Always|SpaceBeforeParens: Custom" +ChoicesReadable="(Never) Never put a space before opening parentheses.|(ControlStatements) Put a space before opening parentheses only after control statement keywords (for/if/while...).|(ControlStatementsExceptForEachMacros) Same as ControlStatements except this option doesn’t apply to ForEach macros. This is useful in projects where ForEach macros are treated as function calls instead of control statements.|(NonEmptyParentheses) Put a space before opening parentheses only if the parentheses are not empty i.e. '()'|(Always) Always put a space before opening parentheses, except when it’s prohibited by the syntax rules (in function-like macro definitions) or when determined by other style rules (after unary operators, opening parentheses, etc.)|(Custom) Configure each individual space before parentheses in SpaceBeforeParensOptions." +ValueDefault=1 + +[SpaceBeforeParensOptions] +Category=5 +Description="Control of individual space before parentheses.

If SpaceBeforeParens is set to Custom, use this to specify how each individual space before parentheses case should be handled. Otherwise, this is ignored." +EditorType=boolean +TrueFalse="SpaceBeforeParensOptions:|SpaceBeforeParensOptions:" +Value=1 +ValueDefault=1 + +[ - AfterControlStatements] +Category=5 +Description="If true, put space betwee control statement keywords (for/if/while...) and opening parentheses.

true:                                  false:
if (...) {} vs. if(...) {}
" +EditorType=boolean +TrueFalse=" AfterControlStatements: true| AfterControlStatements: false" +Value=0 +ValueDefault=0 + +[ - AfterForeachMacros] +Category=5 +Description="If true, put space between foreach macros and opening parentheses.
true:                                  false:
FOREACH (...) vs. FOREACH(...)
<loop-body> <loop-body>
" +EditorType=boolean +TrueFalse=" AfterForeachMacros: true| AfterForeachMacros: false" +Value=0 +ValueDefault=0 + +[ - AfterFunctionDeclarationName] +Category=5 +Description="If true, put a space between function declaration name and opening parentheses.
true:                                  false:
void f (); vs. void f();
" +EditorType=boolean +TrueFalse=" AfterFunctionDeclarationName: true| AfterFunctionDeclarationName: false" +Value=0 +ValueDefault=0 + +[ - AfterFunctionDefinitionName] +Category=5 +Description="If true, put a space between function definition name and opening parentheses.
true:                                  false:
void f () {} vs. void f() {}
" +EditorType=boolean +TrueFalse=" AfterFunctionDefinitionName: true| AfterFunctionDefinitionName: false" +Value=0 +ValueDefault=0 + +[ - AfterIfMacros] +Category=5 +Description="If true, put space between if macros and opening parentheses.
true:                                  false:
IF (...) vs. IF(...)
<conditional-body> <conditional-body>
" +EditorType=boolean +TrueFalse=" AfterIfMacros: true| AfterIfMacros: false" +Value=0 +ValueDefault=0 + +[ - AfterOverloadedOperator] +Category=5 +Description="If true, put a space between operator overloading and opening parentheses.
true:                                  false:
void operator++ (int a); vs. void operator++(int a);
object.operator++ (10); object.operator++(10);
" +EditorType=boolean +TrueFalse=" AfterOverloadedOperator: true| AfterOverloadedOperator: false" +Value=0 +ValueDefault=0 + +[ - AfterRequiresInClause] +Category=5 +Description="If true, put space between requires keyword in a requires clause and opening parentheses, if there is one.
true:                                  false:
template<typename T> vs. template<typename T>
requires (A<T> && B<T>) requires(A<T> && B<T>)
... ...
" +EditorType=boolean +TrueFalse=" AfterRequiresInClause: true| AfterRequiresInClause: false" +Value=0 +ValueDefault=0 + +[ - AfterRequiresInExpression] +Category=5 +Description="If true, put space between requires keyword in a requires expression and opening parentheses.
true:                                  false:
template<typename T> vs. template<typename T>
concept C = requires (T t) { concept C = requires(T t) {
... ...
} }
" +EditorType=boolean +TrueFalse=" AfterRequiresInExpression: true| AfterRequiresInExpression: false" +Value=0 +ValueDefault=0 + +[ - BeforeNonEmptyParentheses] +Category=5 +Description="If true, put a space before opening parentheses only if the parentheses are not empty.
true:                                  false:
void f (int a); vs. void f();
f (a); f();
" +EditorType=boolean +TrueFalse=" BeforeNonEmptyParentheses: true| BeforeNonEmptyParentheses: false" +Value=0 +ValueDefault=0 + +[SpaceBeforeRangeBasedForLoopColon] +Category=5 +Description="If false, spaces will be removed before range-based for loop colon.
true:                                  false:
for (auto v : values) {} vs. for(auto v: values) {}
" +EditorType=boolean +TrueFalse="SpaceBeforeRangeBasedForLoopColon: true|SpaceBeforeRangeBasedForLoopColon: false" +Value=1 +ValueDefault=1 + +[SpaceBeforeSquareBrackets] +Category=5 +Description="If true, spaces will be before [. Lambdas will not be affected. Only the first [ will get a space added.
true:                                  false:
int a [5]; vs. int a[5];
int a [5][5]; vs. int a[5][5];
" +EditorType=boolean +TrueFalse="SpaceBeforeSquareBrackets: true|SpaceBeforeSquareBrackets: false" +Value=0 +ValueDefault=0 + +[SpaceInEmptyBlock] +Category=5 +Description="If true, spaces will be inserted into {}.
true:                                false:
void f() { } vs. void f() {}
while (true) { } while (true) {}
" +EditorType=boolean +TrueFalse="SpaceInEmptyBlock: true|SpaceInEmptyBlock: false" +Value=0 +ValueDefault=0 + +[SpaceBeforeTrailingComments] +Category=5 +Description="The number of spaces before trailing line comments (// - comments).

This does not affect trailing block comments (/* - comments) as those commonly have different usage patterns and a number of special cases. In the case of Verilog, it doesn't affect a comment right after the opening parenthesis in the port or parameter list in a module header, because it is probably for the port on the following line instead of the parenthesis it follows.

SpacesBeforeTrailingComments: 3
void f() {
if (true) { // foo1
f(); // bar
} // foo
}
" +EditorType=numeric +Enabled=false +CallName="SpaceBeforeTrailingComments: " +MaxVal=100 +MinVal=0 +Value=1 +ValueDefault=1 + +[SpacesInAngles] +Category=5 +Description="(SpacesInAngles) The SpacesInAnglesStyle to use for template argument lists." +EditorType=multiple +Enabled=false +Choices="SpacesInAngles: Never|SpacesInAngles: Always|SpacesInAngles: Leave" +ChoicesReadable="(Never) Remove spaces after < and before >.|(Always) Add spaces after < and before >.|(Leave) Keep a single space after < and before > if any spaces were present. Option 'Standard: Cpp03' takes precedence." +ValueDefault=0 + +[SpacesInContainerLiterals] +Category=5 +Description="If true, spaces are inserted inside container literals (e.g. ObjC and Javascript array and dict literals). For JSON, use SpaceBeforeJsonColon instead.
true:                                  false:
var arr = [ 1, 2, 3 ]; vs. var arr = [1, 2, 3];
f({a : 1, b : 2, c : 3}); f({a: 1, b: 2, c: 3});
" +EditorType=boolean +TrueFalse="SpacesInContainerLiterals: true|SpacesInContainerLiterals: false" +Value=0 +ValueDefault=0 + +[SpacesInLineCommentPrefix] +Category=5 +Description="How many spaces are allowed at the start of a line comment. To disable the maximum set it to -1, apart from that the maximum takes precedence over the minimum.
Minimum = 1
Maximum = -1
// One space is forced
// but more spaces are possible

Minimum = 0
Maximum = 0
//Forces to start every comment directly after the slashes
Note that in line comment sections the relative indent of the subsequent lines is kept, that means the following:
before:                                   after:
Minimum: 1
//if (b) { // if (b) {
// return true; // return true;
//} // }

Maximum: 0
/// List: ///List:
/// - Foo /// - Foo
/// - Bar /// - Bar
This option has only effect if ReflowComments is set to true." +EditorType=boolean +TrueFalse="SpacesInLineCommentPrefix:|SpacesInLineCommentPrefix:" +Value=1 +ValueDefault=1 + +[Minimum] +Category=5 +Description="The minimum number of spaces at the start of the comment." +EditorType=numeric +Enabled=true +CallName=" Minimum: " +MaxVal=10000000 +MinVal=0 +Value=1 +ValueDefault=1 + +[Maximum] +Category=5 +Description="The maximum number of spaces at the start of the comment." +EditorType=numeric +Enabled=true +CallName=" Maximum: " +MaxVal=10000000 +MinVal=-1 +Value=-1 +ValueDefault=-1 + +[SpacesInParens] +Category=5 +Description="Defines in which cases spaces will be inserted after ( and before ).

Possible values:

" +EditorType=boolean +TrueFalse="SpacesInParens: Custom|SpacesInParens: Never" +Value=0 +ValueDefault=0 + +[SpacesInParensOptions] +Category=5 +Description="Control of individual spaces in parentheses.

If SpacesInParens is set to Custom, use this to specify how each individual space in parentheses case should be handled. Otherwise this is ignored.

# Example of usage:
SpacesInParens: Custom
SpacesInParensOptions:
InConditionalStatements: true
InEmptyParentheses: true
" +EditorType=boolean +TrueFalse="SpacesInParensOptions:|SpacesInParensOptions" +Value=0 +ValueDefault=0 + +[ - InConditionalStatements (SpacesInParensOptions)] +Category=5 +Description="Put a space in parentheses only inside conditional statements (for/if/while/switch...).
true:                                  false:
if ( a ) { ... } vs. if (a) { ... }
while ( i < 5 ) { ... } while (i < 5) { ... }
" +EditorType=boolean +TrueFalse=" InConditionalStatements: true| InConditionalStatements: false" +Value=0 +ValueDefault=0 + +[ - InCStyleCasts (SpacesInParensOptions)] +Category=5 +Description="Put a space in C style casts.
true:                                  false:
x = ( int32 )y vs. x = (int32)y
" +EditorType=boolean +TrueFalse=" InCStyleCasts: true| InCStyleCasts: false" +Value=0 +ValueDefault=0 + +[ - InEmptyParentheses (SpacesInParensOptions)] +Category=5 +Description="Put a space in parentheses only if the parentheses are empty i.e. '()'
true:                                false:
void f( ) { vs. void f() {
int x[] = {foo( ), bar( )}; int x[] = {foo(), bar()};
if (true) { if (true) {
f( ); f();
} }
} }
" +EditorType=boolean +TrueFalse=" InEmptyParentheses: true| InEmptyParentheses: false" +Value=0 +ValueDefault=0 + +[ - Other (SpacesInParensOptions)] +Category=5 +Description="Put a space in parentheses not covered by preceding options.
true:                                  false:
t f( Deleted & ) & = delete; vs. t f(Deleted &) & = delete;
" +EditorType=boolean +TrueFalse=" Other: true| Other: false" +Value=0 +ValueDefault=0 + +[SpacesInSquareBrackets] +Category=5 +Description="If true, spaces will be inserted after [ and before ]. Lambdas without arguments or unspecified size array declarations will not be affected.
true:                                  false:
int a[ 5 ]; vs. int a[5];
std::unique_ptr<int[]> foo() {} // Won't be affected
" +EditorType=boolean +TrueFalse="SpacesInSquareBrackets: true|SpacesInSquareBrackets: false" +Value=0 +ValueDefault=0 + +[Standard] +Category=0 +Description="(Standard) Parse and format C++ constructs compatible with this standard.
c++03:                                 latest:
vector<set<int> > x; vs. vector<set<int>> x;
" +EditorType=multiple +Enabled=false +Choices="Standard: c++03|Standard: c++11|Standard: c++14|Standard: c++17|Standard: c++20|Standard: Latest|Standard: Auto" +ChoicesReadable="(c++03) Parse and format as C++03. 'Cpp03' is a deprecated alias for 'c++03'.|(c++11) Parse and format as C++11.|(c++14) Parse and format as C++14.|(c++17) Parse and format as C++17.|(c++20) Parse and format as C++20.|(Latest) Parse and format using the latest supported language version. 'Cpp11' is a deprecated alias for 'Latest'.|(Auto) Automatic detection based on the input." +ValueDefault=6 + +[StatementAttributeLikeMacros] +Category=4 +Description="Macros which are ignored in front of a statement, as if they were an attribute. So that they are not parsed as identifier, for example for Qts emit.
AlignConsecutiveDeclarations: true
StatementAttributeLikeMacros: []
unsigned char data = 'x';
emit signal(data); // This is parsed as variable declaration.

AlignConsecutiveDeclarations: true
StatementAttributeLikeMacros: [emit]
unsigned char data = 'x';
emit signal(data); // Now it's fine again.
" +EditorType=string +CallName="StatementAttributeLikeMacros: " +Enabled=false +Value="['Q_EMIT']" +ValueDefault="['Q_EMIT']" + +[StatementMacros] +Category=7 +Description="A vector of macros that should be interpreted as complete statements.

Typical macros are expressions, and require a semi-colon to be added; sometimes this is not the case, and this allows to make clang-format aware of such cases.

For example: Q_UNUSED" +EditorType=string +CallName="StatementMacros: " +Enabled=false +Value="['Q_UNUSED', 'QT_REQUIRE_VERSION']" +ValueDefault="['Q_UNUSED', 'QT_REQUIRE_VERSION']" + +[TabWidth] +Category=3 +Description="The number of columns used for tab stops." +EditorType=numeric +Enabled=false +CallName="TabWidth: " +MaxVal=100 +MinVal=0 +Value=8 +ValueDefault=8 + +[TypeNames] +Category=5 +Description="A vector of non-keyword identifiers that should be interpreted as type names.

A *, &, or && between a type name and another non-keyword identifier is annotated as a pointer or reference token instead of a binary operator.

" +LIST_ENTRY." +EditorType=string +CallName="TypeNames: " +Enabled=false +Value="[]" +ValueDefault="[]" + +[TypenameMacros] +Category=7 +Description="A vector of macros that should be interpreted as type declarations instead of as function calls.

These are expected to be macros of the form:

STACK_OF(...)

In the .clang-format configuration file, this can be configured like:

TypenameMacros: ['STACK_OF', 'LIST']

For example: OpenSSL STACK_OF, BSD LIST_ENTRY." +EditorType=string +CallName="TypenameMacros: " +Enabled=false +Value="[]" +ValueDefault="[]" + +[UseTab] +Category=3 +Description="(UseTab) The way to use tab characters in the resulting file." +EditorType=multiple +Enabled=false +Choices="UseTab: Never|UseTab: ForIndentation|UseTab: ForContinuationAndIndentation|UseTab: Always" +ChoicesReadable="(Never) Never use tab.|(ForIndentation) Use tabs only for indentation.|(ForContinuationAndIndentation) Fill all leading whitespace with tabs, and use spaces for alignment that appears within a line (e.g. consecutive assignments and declarations).|(AlignWithSpaces) Use tabs for line continuation and indentation, and spaces for alignment.|(Always) Use tabs whenever we need to fill whitespace that spans at least from one tab stop to the next one." +ValueDefault=0 + +[VerilogBreakBetweenInstancePorts] +Category=1 +Description="For Verilog, put each port on its own line in module instantiations.

true:
ffnand ff1(.q(),
.qbar(out1),
.clear(in1),
.preset(in2));

false:
ffnand ff1(.q(), .qbar(out1), .clear(in1), .preset(in2));
" +EditorType=boolean +TrueFalse="VerilogBreakBetweenInstancePorts: true|VerilogBreakBetweenInstancePorts: false" +Value=1 +ValueDefault=1 + +[WhitespaceSensitiveMacros] +Category=7 +Description="A vector of macros which are whitespace-sensitive and should not be touched.

These are expected to be macros of the form:

STRINGIZE(...)
In the .clang-format configuration file, this can be configured like:
WhitespaceSensitiveMacros: ['STRINGIZE', 'PP_STRINGIZE']
For example: BOOST_PP_STRINGIZE." +EditorType=string +CallName="WhitespaceSensitiveMacros: " +Enabled=false +Value="['STRINGIZE', 'PP_STRINGIZE', 'BOOST_PP_STRINGIZE']" +ValueDefault="['STRINGIZE', 'PP_STRINGIZE', 'BOOST_PP_STRINGIZE']" diff --git a/readme.html b/readme.html index 65c4def..197bd9e 100644 --- a/readme.html +++ b/readme.html @@ -63,6 +63,7 @@

Features