From 9c18013fccadcbc3c049130d995467373b760147 Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sun, 20 May 2018 16:32:00 +0100 Subject: [PATCH 01/11] Support ClangFormat v7.0.0 Add an indenter configuration file for [ClangFormat v7.0.0](http://releases.llvm.org/7.0.0/tools/clang/docs/ClangFormat.html). It can generate all the documented `.clang-format` options, except the following: - `ExperimentalAutoDetectBinPacking`, because it is discouraged from use in config files. - `AlwaysBreakAfterDefinitionReturnType`, as it is now deprecated. - `IncludeCategories` and `RawStringFormats`, because their option values are highly structured YAML and beyond the capabilities of UniversalIndentGUI. Also enlist ClangFormat in the list of supported indenters in the text, HTML and Markdown README files (but not in the binary PDF file) and in the release packaging scripts. --- README.md | 3 +- README_older_but_worth_reading.txt | 1 + buildRelease.sh | 2 +- buildwin32release_gcc.bat | 2 +- indenters/uigui_clangformat.ini | 900 +++++++++++++++++++++++++++++ readme.html | 3 +- 6 files changed, 907 insertions(+), 4 deletions(-) create mode 100644 indenters/uigui_clangformat.ini diff --git a/README.md b/README.md index 6a5bd9d..59591c5 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://clang.llvm.org/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..48ff831 --- /dev/null +++ b/indenters/uigui_clangformat.ini @@ -0,0 +1,900 @@ +[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|*.m|*.mm|*.M|*.proto +indenterFileName=clang-format +indenterName=ClangFormat (C, C++, Java, JavaScript, ObjC, ObjC++, ProtoBuf) +inputFileName=indentinput +inputFileParameter="-style=file -i " +manual=http://releases.llvm.org/7.0.0/tools/clang/docs/ClangFormatStyleOptions.html +outputFileName=indentinput +outputFileParameter=none +parameterOrder=pio +stringparaminquotes=false +showHelpParameter=-help +useCfgFileParameter=none +version=7.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: ObjC|Language: Proto|Language: TextProto|Language: TableGen" +ChoicesReadable="(Cpp) C, C++|(Java) Java|(JavaScript) JavaScript|(ObjC) Objective C, Objective C++|(Proto) Protocol Buffers|(TextProto) Protocol Buffer messages in text format|(TableGen) TableGen" +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" +ChoicesReadable="(LLVM) LLVM coding standards - http://llvm.org/docs/CodingStandards.html|(Google) Google’s C++ style guide - https://google.github.io/styleguide/cppguide.html|(Chromium) Chromium’s style guide - http://www.chromium.org/developers/coding-style|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(WebKit) WebKit’s style guide - http://www.webkit.org/coding/coding-style.html" +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" +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." +ValueDefault=0 + +[AlignConsecutiveAssignments] +Category=4 +Description="Aligns consecutive assignments.

This will align the assignment operators of consecutive lines. This will result in formattings like

int aaaa = 12;
int b = 23;
int ccc = 23;
" +EditorType=boolean +TrueFalse="AlignConsecutiveAssignments: true|AlignConsecutiveAssignments: false" +Value=0 +ValueDefault=0 + +[AlignConsecutiveDeclarations] +Category=4 +Description="Aligns consecutive declarations.

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

int         aaaa = 12;
float b = 23;
std::string ccc = 23;
" +EditorType=boolean +TrueFalse="AlignConsecutiveDeclarations: true|AlignConsecutiveDeclarations: 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="Horizontally align operands of binary and ternary expressions.

Specifically, this aligns operands of a single expression that needs to be split over multiple lines, e.g.:

int aaa = bbbbbbbbbbbbbbb +
ccccccccccccccc;
" +EditorType=boolean +TrueFalse="AlignOperands: true|AlignOperands: false" +Value=1 +ValueDefault=1 + +[AlignTrailingComments] +Category=4 +Description="Aligns trailing comments.
true:                                   false:
int a; // My comment a vs. int a; // My comment a
int b = 2; // comment b int b = 2; // comment about b
" +EditorType=boolean +TrueFalse="AlignTrailingComments: true|AlignTrailingComments: 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="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=boolean +TrueFalse="AllowShortBlocksOnASingleLine: true|AllowShortBlocksOnASingleLine: false" +Value=0 +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 + +[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="if (a) return; can be put on a single line.

Note: If the statement body is a block then AllowShortBlocksOnASingleLine is also needed." +EditorType=boolean +TrueFalse="AllowShortIfStatementsOnASingleLine: true|AllowShortIfStatementsOnASingleLine: false" +Value=0 +ValueDefault=0 + +[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 + +[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 + +[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 + +[ - 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="Wrap control statements (if/for/while/switch/..).
true:
if (foo())
{
} else
{}
for (int i = 0; i < 10; ++i)
{}

false:
if (foo()) {
} else {
}
for (int i = 0; i < 10; ++i) {
}
" +EditorType=boolean +TrueFalse=" AfterControlStatement: true| AfterControlStatement: false" +Value=0 +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…). @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 + +[ - 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).
int f()   vs.   inf 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.
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.
namespace Foo   vs.  namespace Foo
{} {
}
" +EditorType=boolean +TrueFalse=" SplitEmptyNamespace: true| SplitEmptyNamespace: false" +Value=1 +ValueDefault=1 + +[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 + +[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: 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.|(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 + +[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 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" +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." +ValueDefault=0 + +[BreakStringLiterals] +Category=1 +Description="Allow breaking string literals when formatting." +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="If the constructor initializers don’t fit on a line, put each initializer on its own line.
true:
SomeClass::Constructor()
: aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
return 0;
}

false:
SomeClass::Constructor()
: aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa),
aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
return 0;
}
" +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 + +[FixNamespaceComments] +Category=7 +Description="If true, clang-format adds missing namespace end comments and fixes invalid existing ones.
true:                                  false:
namespace a { vs. namespace a {
foo(); foo();
} // namespace a; }
" +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']" + +[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="''" + +[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.

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 + +[IndentPPDirectives] +Category=3 +Description="The preprocessor directive indenting style to use." +EditorType=boolean +TrueFalse="IndentPPDirectives: AfterHash|IndentPPDirectives: None" +Value=0 +ValueDefault=0 + +[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 + +[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 + +[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 + +[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="''" + +[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 + +[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 + +[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 + +[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 + +[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 + +[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 + +[ReflowComments] +Category=1 +Description="If true, clang-format will attempt to re-flow comments.
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 + +[SortIncludes] +Category=7 +Description="If true, clang-format will sort #includes.
false:                                 true:
#include "b.h" vs. #include "a.h"
#include "a.h" #include "b.h"
" +EditorType=boolean +TrueFalse="SortIncludes: true|SortIncludes: false" +Value=1 +ValueDefault=1 + +[SortUsingDeclarations] +Category=7 +Descriptions="If true, clang-format will sort using declarations.

The order of using declarations is 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.

false:                                 true:
using std::cout; vs. using std::cin;
using std::cin; using std::cout;
" +EditorType=boolean +TrueFalse="SortUsingDeclarations: true|SortUsingDeclarations: false" +Value=1 +ValueDefault=1 + +[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 + +[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 + +[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 + +[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 + +[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: Always" +ChoicesReadable="(Never) Never put a space before opening parentheses.|(ControlStatements) Put a space before opening parentheses only after control statement keywords (for/if/while...).|(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.)" +ValueDefault=1 + +[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 + +[SpaceInEmptyParentheses] +Category=5 +Description="If true, spaces may be inserted into ().
true:                                false:
void f( ) { vs. void f() {
int x[] = {foo( ), bar( )}; int x[] = {foo(), bar()};
if (true) { if (true) {
f( ); f();
} }
} }
" +EditorType=boolean +TrueFalse="SpaceInEmptyParentheses: true|SpaceInEmptyParentheses: 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.

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="If true, spaces will be inserted after < and before > in template argument lists.
true:                                  false:
static_cast< int >(arg); vs. static_cast<int>(arg);
std::function< void(int) > fct; std::function<void(int)> fct;
" +EditorType=boolean +TrueFalse="SpacesInAngles: true|SpacesInAngles: false" +Value=0 +ValueDefault=0 + +[SpacesInCStyleCastParentheses] +Category=5 +Description="If true, spaces may be inserted into C style casts.
true:                                  false:
x = ( int32 )y vs. x = (int32)y
" +EditorType=boolean +TrueFalse="SpacesInCStyleCastParentheses: true|SpacesInCStyleCastParentheses: false" +Value=0 +ValueDefault=0 + +[SpacesInContainerLiterals] +Category=5 +Description="If true, spaces are inserted inside container literals (e.g. ObjC and Javascript array and dict literals).
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 + +[SpacesInParentheses] +Category=5 +Description="If true, spaces will be inserted after ( and before ).
true:                                  false:
t f( Deleted & ) & = delete; vs. t f(Deleted &) & = delete;
" +EditorType=boolean +TrueFalse="SpacesInParentheses: true|SpacesInParentheses: false" +Value=0 +ValueDefault=0 + +[SpacesInSquareBrackets] +Category=5 +Description="If true, spaces will be inserted after [ and before ]. Lambdas 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)Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for Cpp03." +EditorType=multiple +Enabled=false +Choices="Standard: Cpp03|Standard: Cpp11|Standard: Auto" +ChoicesReadable="(Cpp03) Use C++03-compatible syntax.|(Cpp11) Use features of C++11, C++14 and C++1z (e.g. A> instead of A >).|(Auto) Automatic detection based on the input." +ValueDefault=2 + +[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 + +[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) Use tabs only for line continuation and indentation.|(Always) Use tabs whenever we need to fill whitespace that spans at least from one tab stop to the next one." +ValueDefault=0 diff --git a/readme.html b/readme.html index 65c4def..6509288 100644 --- a/readme.html +++ b/readme.html @@ -63,6 +63,7 @@

Features

  • Artistic Styler
  • BCPP
  • +
  • ClangFormat
  • Cobol Beautify
  • CSSTidy
  • Fortran 90 PPR
  • @@ -187,7 +188,7 @@

    How to install / build UniversalIndentGUI

    Indenter binary packages can be downloaded from the project at SourceForge - here. + here. ClangFormat is not part of them (yet), and you can download it separately at the LLVM Builds page. (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.

    From 1f5cde2607ececbd805191fdd5120fff09086573 Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Mon, 22 Oct 2018 02:54:47 +0100 Subject: [PATCH 02/11] ClangFormat v8.0.0 --- indenters/uigui_clangformat.ini | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 48ff831..52eaf7c 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -7,14 +7,14 @@ indenterFileName=clang-format indenterName=ClangFormat (C, C++, Java, JavaScript, ObjC, ObjC++, ProtoBuf) inputFileName=indentinput inputFileParameter="-style=file -i " -manual=http://releases.llvm.org/7.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/8.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio stringparaminquotes=false showHelpParameter=-help useCfgFileParameter=none -version=7.0.0 +version=8.0.0 [Language] Category=0 @@ -31,7 +31,7 @@ Description="(BasedOnStyle) The style used for all options not specificall EditorType=multiple Enabled=false Choices="BasedOnStyle: LLVM|BasedOnStyle: Google|BasedOnStyle: Chromium|BasedOnStyle: Mozilla|BasedOnStyle: WebKit" -ChoicesReadable="(LLVM) LLVM coding standards - http://llvm.org/docs/CodingStandards.html|(Google) Google’s C++ style guide - https://google.github.io/styleguide/cppguide.html|(Chromium) Chromium’s style guide - http://www.chromium.org/developers/coding-style|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(WebKit) WebKit’s style guide - http://www.webkit.org/coding/coding-style.html" +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 - http://www.chromium.org/developers/coding-style|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(WebKit) WebKit’s style guide - http://www.webkit.org/coding/coding-style.html" ValueDefault=0 [AccessModifierOffset] @@ -526,6 +526,15 @@ TrueFalse="IndentWrappedFunctionNames: true|IndentWrappedFunctionNames: false" Value=0 ValueDefault=0 +[JavaImportGroups] +Category=7 +Description="

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

    Each group is separated by a newline. Static imports will also follow the same grouping convention above all non-static 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.

    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." @@ -879,6 +888,15 @@ Choices="Standard: Cpp03|Standard: Cpp11|Standard: Auto" ChoicesReadable="(Cpp03) Use C++03-compatible syntax.|(Cpp11) Use features of C++11, C++14 and C++1z (e.g. A> instead of A >).|(Auto) Automatic detection based on the input." ValueDefault=2 +[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." From 66dc85bc7e2b67b13330a4796e4716c5bd7d5c6f Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Wed, 16 Oct 2019 12:59:26 +0100 Subject: [PATCH 03/11] ClangFormat v9.0.0 - Incorporate changes from llvm/llvm-project adcb3f5, 15000a1, 701a0d7, cbb726d, c6deae4, a83e2db, 91f60b4, 806d574, d7f287f, c5227a1, e8a301f and 04ee232. - Change ClangFormat webpage links to versioned ones. --- README.md | 2 +- indenters/uigui_clangformat.ini | 107 ++++++++++++++++++++++++++------ readme.html | 2 +- 3 files changed, 90 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 59591c5..b54b15b 100644 --- a/README.md +++ b/README.md @@ -25,7 +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://clang.llvm.org/docs/ClangFormat.html) +* [ClangFormat](https://releases.llvm.org/9.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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 52eaf7c..76a70e0 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -2,27 +2,27 @@ 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|*.m|*.mm|*.M|*.proto +fileTypes=*.cpp|*.cxx|*.C|*.c|*.h|*.hpp|*.java|*.js|*.m|*.mm|*.M|*.proto|*.cs indenterFileName=clang-format -indenterName=ClangFormat (C, C++, Java, JavaScript, ObjC, ObjC++, ProtoBuf) +indenterName=ClangFormat (C, C++, Java, JavaScript, ObjC, ObjC++, ProtoBuf, C#) inputFileName=indentinput inputFileParameter="-style=file -i " -manual=https://releases.llvm.org/8.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/9.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio stringparaminquotes=false showHelpParameter=-help useCfgFileParameter=none -version=8.0.0 +version=9.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: ObjC|Language: Proto|Language: TextProto|Language: TableGen" -ChoicesReadable="(Cpp) C, C++|(Java) Java|(JavaScript) JavaScript|(ObjC) Objective C, Objective C++|(Proto) Protocol Buffers|(TextProto) Protocol Buffer messages in text format|(TableGen) TableGen" +Choices="Language: Cpp|Language: Java|Language: JavaScript|Language: ObjC|Language: Proto|Language: TextProto|Language: TableGen|Language: CSharp" +ChoicesReadable="(Cpp) C, C++|(Java) Java|(JavaScript) JavaScript|(ObjC) Objective C, Objective C++|(Proto) Protocol Buffers|(TextProto) Protocol Buffer messages in text format|(TableGen) TableGen|(CSharp) C#" ValueDefault=0 [BasedOnStyle] @@ -30,8 +30,8 @@ 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" -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 - http://www.chromium.org/developers/coding-style|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(WebKit) WebKit’s style guide - http://www.webkit.org/coding/coding-style.html" +Choices="BasedOnStyle: LLVM|BasedOnStyle: Google|BasedOnStyle: Chromium|BasedOnStyle: Mozilla|BasedOnStyle: WebKit|BasedOnStyle: Microsoft" +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://www.chromium.org/developers/coding-style|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(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?view=vs-2017" ValueDefault=0 [AccessModifierOffset] @@ -70,6 +70,14 @@ TrueFalse="AlignConsecutiveDeclarations: true|AlignConsecutiveDeclarations: fals Value=0 ValueDefault=0 +[AlignConsecutiveMacros] +Category=4 +Description="If true, aligns consecutive C/C++ preprocessor macros.

    This will align the C/C++ preprocessor macros of consecutive lines. This 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=boolean +TrueFalse="AlignConsecutiveMacros: true|AlignConsecutiveMacros: false" +Value=0 +ValueDefault=0 + [AlignEscapedNewlines] Category=4 Description="(AlignEscapedNewlines) Options for aligning backslashes in escaped newlines." @@ -95,6 +103,22 @@ TrueFalse="AlignTrailingComments: true|AlignTrailingComments: false" Value=1 ValueDefault=1 +[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="If a constructor definition with a member initializer list doesn’t fit on a single line, allow putting all member initializers onto the next line, if ConstructorInitializerAllOnOneLineOrOnePerLine is true. Note that this parameter has no effect if ConstructorInitializerAllOnOneLineOrOnePerLine is false.
    true:
    MyClass::MyClass() :
    member0(0), member1(2) {}

    false:
    MyClass::MyClass() :
    member0(0),
    member1(2) {}
    " +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);
    " @@ -130,12 +154,22 @@ ValueDefault=4 [AllowShortIfStatementsOnASingleLine] Category=1 -Description="if (a) return; can be put on a single line.

    Note: If the statement body is a block then AllowShortBlocksOnASingleLine is also needed." -EditorType=boolean -TrueFalse="AllowShortIfStatementsOnASingleLine: true|AllowShortIfStatementsOnASingleLine: false" -Value=0 +Description="(AllowShortIfStatementsOnASingleLine) If true, if (a) return; can be put on a single line." +EditorType=multiple +Enabled=false +Choices="AllowShortIfStatementsOnASingleLine: Never|AllowShortIfStatementsOnASingleLine: WithoutElse|AllowShortIfStatementsOnASingleLine: Always" +ChoicesReadable="(Never) Never put short ifs on the same line.|(WithoutElse) Without else put short ifs on the same line only if the else is not a compound statement.|(Always) Always put short ifs on the same line if the else is not a compound statement or not." 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 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." @@ -194,6 +228,14 @@ 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
    {};
    " @@ -458,7 +500,7 @@ ValueDefault=0 [FixNamespaceComments] Category=7 -Description="If true, clang-format adds missing namespace end comments and fixes invalid existing ones.
    true:                                  false:
    namespace a { vs. namespace a {
    foo(); foo();
    } // namespace a; }
    " +Description="If true, clang-format adds missing namespace end comments and fixes invalid existing ones.
    true:                                  false:
    namespace a { vs. namespace a {
    foo(); foo();
    } // namespace a }
    " EditorType=boolean TrueFalse="FixNamespaceComments: true|FixNamespaceComments: false" Value=1 @@ -501,10 +543,11 @@ ValueDefault=0 [IndentPPDirectives] Category=3 -Description="The preprocessor directive indenting style to use." -EditorType=boolean -TrueFalse="IndentPPDirectives: AfterHash|IndentPPDirectives: None" -Value=0 +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 [IndentWidth] @@ -598,6 +641,15 @@ Choices="NamespaceIndentation: None|NamespaceIndentation: Inner|NamespaceIndenta 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> {
    }
    " @@ -763,6 +815,14 @@ 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();
    " @@ -808,8 +868,8 @@ 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: Always" -ChoicesReadable="(Never) Never put a space before opening parentheses.|(ControlStatements) Put a space before opening parentheses only after control statement keywords (for/if/while...).|(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.)" +Choices="SpaceBeforeParens: Never|SpaceBeforeParens: ControlStatements|SpaceBeforeParens: NonEmptyParentheses|SpaceBeforeParens: Always" +ChoicesReadable="(Never) Never put a space before opening parentheses.|(ControlStatements) Put a space before opening parentheses only after control statement keywords (for/if/while...).|(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.)" ValueDefault=1 [SpaceBeforeRangeBasedForLoopColon] @@ -908,6 +968,15 @@ MinVal=0 Value=8 ValueDefault=8 +[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." diff --git a/readme.html b/readme.html index 6509288..2d43d88 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

    Features

    • Artistic Styler
    • BCPP
    • -
    • ClangFormat
    • +
    • ClangFormat
    • Cobol Beautify
    • CSSTidy
    • Fortran 90 PPR
    • From 011c1268507cfb35ed8f709476c83735a516a3af Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sat, 28 Mar 2020 19:30:15 +0000 Subject: [PATCH 04/11] ClangFormat v10.0.0 Incorporate changes from llvm/llvm-project 0e074fa, db4ad36, 10234da, 37860d5, 3867a2d, a506ed2, e503256, fb13e65, b3cc321, 375a84b, c209598, 23b7836, eadb65f, 335ac2e, a4a7c12, 26748a3 and 4daa8d1. --- README.md | 2 +- indenters/uigui_clangformat.ini | 99 ++++++++++++++++++++++++++------- readme.html | 2 +- 3 files changed, 81 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b54b15b..46c3940 100644 --- a/README.md +++ b/README.md @@ -25,7 +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/9.0.0/tools/clang/docs/ClangFormat.html) +* [ClangFormat](https://releases.llvm.org/10.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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 76a70e0..cd9fc50 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -7,7 +7,7 @@ indenterFileName=clang-format indenterName=ClangFormat (C, C++, Java, JavaScript, ObjC, ObjC++, ProtoBuf, C#) inputFileName=indentinput inputFileParameter="-style=file -i " -manual=https://releases.llvm.org/9.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio @@ -31,7 +31,7 @@ Description="(BasedOnStyle) The style used for all options not specificall EditorType=multiple Enabled=false Choices="BasedOnStyle: LLVM|BasedOnStyle: Google|BasedOnStyle: Chromium|BasedOnStyle: Mozilla|BasedOnStyle: WebKit|BasedOnStyle: Microsoft" -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://www.chromium.org/developers/coding-style|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(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?view=vs-2017" +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/+/master/styleguide/styleguide.md|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(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?view=vs-2017" ValueDefault=0 [AccessModifierOffset] @@ -129,10 +129,11 @@ ValueDefault=1 [AllowShortBlocksOnASingleLine] Category=1 -Description="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=boolean -TrueFalse="AllowShortBlocksOnASingleLine: true|AllowShortBlocksOnASingleLine: false" -Value=0 +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] @@ -246,10 +247,11 @@ ValueDefault=0 [ - AfterControlStatement] Category=2 -Description="Wrap control statements (if/for/while/switch/..).

      true:
      if (foo())
      {
      } else
      {}
      for (int i = 0; i < 10; ++i)
      {}

      false:
      if (foo()) {
      } else {
      }
      for (int i = 0; i < 10; ++i) {
      }
      " -EditorType=boolean -TrueFalse=" AfterControlStatement: true| AfterControlStatement: false" -Value=0 +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] @@ -334,7 +336,7 @@ 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).
      int f()   vs.   inf f()
      {} {
      }
      " +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).
      int f()   vs.   int f()
      {} {
      }
      " EditorType=boolean TrueFalse=" SplitEmptyFunction: true| SplitEmptyFunction: false" Value=1 @@ -378,8 +380,8 @@ 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: 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.|(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." +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 [BreakBeforeTernaryOperators] @@ -410,7 +412,7 @@ ValueDefault=0 [BreakStringLiterals] Category=1 -Description="Allow breaking string literals when formatting." +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 @@ -482,6 +484,14 @@ TrueFalse="Cpp11BracedListStyle: true|Cpp11BracedListStyle: false" Value=1 ValueDefault=1 +[DeriveLineEnding] +Category=7 +Description="Analyze the formatted file for the most used line ending (\r\n or \n). UseCRLF is only used as a fallback if none can be derived." +EditorType=boolean +TrueFalse="DeriveLineEnding: true|DeriveLineEnding: false" +Value=0 +ValueDefault=0 + [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." @@ -533,6 +543,15 @@ 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="''" + [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.

      false:                                 true:
      switch (fool) { vs. switch (fool) {
      case 1: case 1:
      bar(); bar();
      break; break;
      default: default:
      plop(); plop();
      } }
      " @@ -541,6 +560,14 @@ TrueFalse="IndentCaseLabels: true|IndentCaseLabels: false" Value=0 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." @@ -833,7 +860,7 @@ ValueDefault=1 [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;
      " +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 @@ -880,6 +907,22 @@ TrueFalse="SpaceBeforeRangeBasedForLoopColon: true|SpaceBeforeRangeBasedForLoopC 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 + [SpaceInEmptyParentheses] Category=5 Description="If true, spaces may be inserted into ().
      true:                                false:
      void f( ) { vs. void f() {
      int x[] = {foo( ), bar( )}; int x[] = {foo(), bar()};
      if (true) { if (true) {
      f( ); f();
      } }
      } }
      " @@ -915,6 +958,14 @@ TrueFalse="SpacesInCStyleCastParentheses: true|SpacesInCStyleCastParentheses: fa Value=0 ValueDefault=0 +[SpacesInConditionalStatement] +Category=5 +Description="If true, spaces will be inserted around if/for/while (and similar) conditions." +EditorType=boolean +TrueFalse="SpacesInConditionalStatement: true|SpacesInConditionalStatement: false" +Value=0 +ValueDefault=0 + [SpacesInContainerLiterals] Category=5 Description="If true, spaces are inserted inside container literals (e.g. ObjC and Javascript array and dict literals).
      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});
      " @@ -933,7 +984,7 @@ ValueDefault=0 [SpacesInSquareBrackets] Category=5 -Description="If true, spaces will be inserted after [ and before ]. Lambdas 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
      " +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 @@ -941,12 +992,12 @@ ValueDefault=0 [Standard] Category=0 -Description="(Standard)Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for
      Cpp03
      ." +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: Cpp03|Standard: Cpp11|Standard: Auto" -ChoicesReadable="(Cpp03) Use C++03-compatible syntax.|(Cpp11) Use features of C++11, C++14 and C++1z (e.g. A> instead of A >).|(Auto) Automatic detection based on the input." -ValueDefault=2 +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 [StatementMacros] Category=7 @@ -977,6 +1028,14 @@ Enabled=false Value="[]" ValueDefault="[]" +[UseCRLF] +Category=7 +Description="Use \r\n instead of \n for line breaks. Also used as fallback if DeriveLineEnding is true." +EditorType=boolean +TrueFalse="UseCRLF: true|UseCRLF: false" +Value=0 +ValueDefault=0 + [UseTab] Category=3 Description="(UseTab) The way to use tab characters in the resulting file." diff --git a/readme.html b/readme.html index 2d43d88..feb88d6 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

      Features

      • Artistic Styler
      • BCPP
      • -
      • ClangFormat
      • +
      • ClangFormat
      • Cobol Beautify
      • CSSTidy
      • Fortran 90 PPR
      • From 8753485f14179a3f62ce55267c271e25cee0150e Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Mon, 19 Oct 2020 00:19:36 +0100 Subject: [PATCH 05/11] ClangFormat v11.0.0 Incorporate changes from llvm/llvm-project 14c0447, 70c9867, dc04c54, fa0118e, 10b1a87, c5c487f, 28ecd7f, e811150, 3d61b11, 47ef09e, 0fa7e4a, 292058a, f21c704, 0ee04e6, b99bf0e, 807ab2c, 6ef45b0, 51dbda5 and 0c332a7. --- README.md | 2 +- indenters/uigui_clangformat.ini | 102 ++++++++++++++++++++++++++++---- readme.html | 2 +- 3 files changed, 91 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 46c3940..62232e9 100644 --- a/README.md +++ b/README.md @@ -25,7 +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/10.0.0/tools/clang/docs/ClangFormat.html) +* [ClangFormat](https://releases.llvm.org/11.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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index cd9fc50..20655c2 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -7,14 +7,14 @@ indenterFileName=clang-format indenterName=ClangFormat (C, C++, Java, JavaScript, ObjC, ObjC++, ProtoBuf, C#) inputFileName=indentinput inputFileParameter="-style=file -i " -manual=https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/11.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio stringparaminquotes=false showHelpParameter=-help useCfgFileParameter=none -version=9.0.0 +version=11.0.0 [Language] Category=0 @@ -30,8 +30,8 @@ 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" -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/+/master/styleguide/styleguide.md|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(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?view=vs-2017" +Choices="BasedOnStyle: LLVM|BasedOnStyle: Google|BasedOnStyle: Chromium|BasedOnStyle: Mozilla|BasedOnStyle: WebKit|BasedOnStyle: Microsoft|BasedOnStyle: GNU" +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/+/master/styleguide/styleguide.md|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(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?view=vs-2017|(GNU) GNU coding standards - https://www.gnu.org/prep/standards/standards.html" ValueDefault=0 [AccessModifierOffset] @@ -62,6 +62,14 @@ TrueFalse="AlignConsecutiveAssignments: true|AlignConsecutiveAssignments: false" Value=0 ValueDefault=0 +[AlignConsecutiveBitFields] +Category=4 +Description="Aligns consecutive bitfield members.

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

        int aaaa : 1;
        int b : 12;
        int ccc : 8;
        " +EditorType=boolean +TrueFalse="AlignConsecutiveBitFields: true|AlignConsecutiveBitFields: false" +Value=0 +ValueDefault=0 + [AlignConsecutiveDeclarations] Category=4 Description="Aligns consecutive declarations.

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

        int         aaaa = 12;
        float b = 23;
        std::string ccc = 23;
        " @@ -89,10 +97,11 @@ ValueDefault=2 [AlignOperands] Category=4 -Description="Horizontally align operands of binary and ternary expressions.

        Specifically, this aligns operands of a single expression that needs to be split over multiple lines, e.g.:

        int aaa = bbbbbbbbbbbbbbb +
        ccccccccccccccc;
        " -EditorType=boolean -TrueFalse="AlignOperands: true|AlignOperands: false" -Value=1 +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] @@ -144,6 +153,14 @@ TrueFalse="AllowShortCaseLabelsOnASingleLine: true|AllowShortCaseLabelsOnASingle 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." @@ -326,6 +343,22 @@ 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." @@ -552,14 +585,31 @@ Enabled=false Value="''" ValueDefault="''" +[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.

        false:                                 true:
        switch (fool) { vs. switch (fool) {
        case 1: case 1:
        bar(); bar();
        break; break;
        default: default:
        plop(); plop();
        } }
        " +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;
        } }
        " @@ -596,6 +646,15 @@ TrueFalse="IndentWrappedFunctionNames: true|IndentWrappedFunctionNames: 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 + [JavaImportGroups] Category=7 Description="

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

        Each group is separated by a newline. Static imports will also follow the same grouping convention above all non-static 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.

        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;
        " @@ -697,6 +756,14 @@ MinVal=0 Value=2 ValueDefault=2 +[ObjCBreakBeforeNestedBlockParam] +Category=1 +Description="Break parameters list into lines when there is nested block parameters in a fuction 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)." @@ -895,8 +962,8 @@ 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: NonEmptyParentheses|SpaceBeforeParens: Always" -ChoicesReadable="(Never) Never put a space before opening parentheses.|(ControlStatements) Put a space before opening parentheses only after control statement keywords (for/if/while...).|(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.)" +Choices="SpaceBeforeParens: Never|SpaceBeforeParens: ControlStatements|SpaceBeforeParens: ControlStatementsExceptForEachMacros|SpaceBeforeParens: NonEmptyParentheses|SpaceBeforeParens: Always" +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.)" ValueDefault=1 [SpaceBeforeRangeBasedForLoopColon] @@ -960,7 +1027,7 @@ ValueDefault=0 [SpacesInConditionalStatement] Category=5 -Description="If true, spaces will be inserted around if/for/while (and similar) conditions." +Description="If true, spaces will be inserted around if/for/switch/while conditions.
        true:                                  false:
        if ( a ) { ... } vs. if (a) { ... }
        while ( i < 5 ) { ... } while (i < 5) { ... }
        " EditorType=boolean TrueFalse="SpacesInConditionalStatement: true|SpacesInConditionalStatement: false" Value=0 @@ -1042,5 +1109,14 @@ 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) Use tabs only for line continuation and indentation.|(Always) Use tabs whenever we need to fill whitespace that spans at least from one tab stop to the next one." +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 + +[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 feb88d6..f2d6068 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

        Features

        • Artistic Styler
        • BCPP
        • -
        • ClangFormat
        • +
        • ClangFormat
        • Cobol Beautify
        • CSSTidy
        • Fortran 90 PPR
        • From 5232c713cfe7ec5f23624cb9c1ed668fe7c554ff Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sun, 9 May 2021 00:28:13 +0100 Subject: [PATCH 06/11] ClangFormat v12.0.0 Incorporate changes from llvm/llvm-project 6d7ec54, 52ab7aa, e7bd058, 4dd9c70, 2e7add8, 9e27f38, 1e4d6d1, 840e651, e9e6e3b, 47877c9, 9af0386, bcc1dee, b43075e, f00a20e, 7b9d88a, 2563147, 33a63a3, 3395a33, 60bf582, f02eca0, 6d5c1cd --- README.md | 2 +- indenters/uigui_clangformat.ini | 142 +++++++++++++++++++++++++++----- readme.html | 2 +- 3 files changed, 124 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 62232e9..119ecb9 100644 --- a/README.md +++ b/README.md @@ -25,7 +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/11.0.0/tools/clang/docs/ClangFormat.html) +* [ClangFormat](https://releases.llvm.org/12.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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 20655c2..3398093 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -7,14 +7,14 @@ indenterFileName=clang-format indenterName=ClangFormat (C, C++, Java, JavaScript, ObjC, ObjC++, ProtoBuf, C#) inputFileName=indentinput inputFileParameter="-style=file -i " -manual=https://releases.llvm.org/11.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/12.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio stringparaminquotes=false showHelpParameter=-help useCfgFileParameter=none -version=11.0.0 +version=12.0.0 [Language] Category=0 @@ -56,34 +56,38 @@ ValueDefault=0 [AlignConsecutiveAssignments] Category=4 -Description="Aligns consecutive assignments.

          This will align the assignment operators of consecutive lines. This will result in formattings like

          int aaaa = 12;
          int b = 23;
          int ccc = 23;
          " -EditorType=boolean -TrueFalse="AlignConsecutiveAssignments: true|AlignConsecutiveAssignments: false" -Value=0 +Description="(AlignConsecutiveAssignments) Style of aligning consecutive assignments.

          Consecutive will result in formattings like:

          int a            = 1;
          int somelongname = 2;
          double c = 3;
          " +EditorType=multiple +Enabled=false +Choices="AlignConsecutiveAssignments: None|AlignConsecutiveAssignments: Consecutive|AlignConsecutiveAssignments: AcrossEmptyLines|AlignConsecutiveAssignments: AcrossComments|AlignConsecutiveAssignments: AcrossEmptyLinesAndComments" +ChoicesReadable="(None) Do not align assignments on consecutive lines.|(Consecutive) Align assignments 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 [AlignConsecutiveBitFields] Category=4 -Description="Aligns consecutive bitfield members.

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

          int aaaa : 1;
          int b : 12;
          int ccc : 8;
          " -EditorType=boolean -TrueFalse="AlignConsecutiveBitFields: true|AlignConsecutiveBitFields: false" -Value=0 +Description="(AlignConsecutiveBitFields) Style of aligning consecutive bit field.

          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="Aligns consecutive declarations.

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

          int         aaaa = 12;
          float b = 23;
          std::string ccc = 23;
          " -EditorType=boolean -TrueFalse="AlignConsecutiveDeclarations: true|AlignConsecutiveDeclarations: false" -Value=0 +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="If true, aligns consecutive C/C++ preprocessor macros.

          This will align the C/C++ preprocessor macros of consecutive lines. This 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=boolean -TrueFalse="AlignConsecutiveMacros: true|AlignConsecutiveMacros: false" -Value=0 +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 [AlignEscapedNewlines] @@ -222,6 +226,15 @@ Choices="AlwaysBreakTemplateDeclarations: No|AlwaysBreakTemplateDeclarations: Mu 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);
          }
          " @@ -238,6 +251,24 @@ 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." @@ -417,6 +448,14 @@ Choices="BreakBeforeBraces: Attach|BreakBeforeBraces: Linux|BreakBeforeBraces: M 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="If true, concept will be placed on a new line.

          true:
          template<typename T>
          concept ...

          false:
          template<typename T> concept ...
          " +EditorType=boolean +TrueFalse="BreakBeforeConceptDeclarations: true|BreakBeforeConceptDeclarations: false" +Value=1 +ValueDefault=1 + [BreakBeforeTernaryOperators] Category=1 Description="Ternary operators will be placed after line breaks.
          true:
          veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription
          ? firstValue
          : SecondValueVeryVeryVeryVeryLong;

          false:
          veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription ?
          firstValue :
          SecondValueVeryVeryVeryVeryLong;
          " @@ -541,6 +580,15 @@ TrueFalse="DisableFormat: true|DisableFormat: false" Value=0 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 and fixes invalid existing ones.
          true:                                  false:
          namespace a { vs. namespace a {
          foo(); foo();
          } // namespace a }
          " @@ -627,6 +675,14 @@ Choices="IndentPPDirectives: None|IndentPPDirectives: AfterHash|IndentPPDirectiv ChoicesReadable="(None) Does not indent any directives.|(AfterHash) Indents directives after the hash.|(BeforeHash) Indents directives before the hash." ValueDefault=0 +[IndentRequires] +Category=3 +Description="Indent the requires clause in a template
          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="IndentRequires: true|IndentRequires: false" +Value=0 +ValueDefault=0 + [IndentWidth] Category=3 Description="The number of columns to use for indentation.
          IndentWidth: 3

          void f() {
          someFunction();
          if (true, false) {
          f();
          }
          }
          " @@ -657,7 +713,7 @@ ValueDefault=0 [JavaImportGroups] Category=7 -Description="

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

          Each group is separated by a newline. Static imports will also follow the same grouping convention above all non-static 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.

          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;
          " +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 @@ -758,7 +814,7 @@ ValueDefault=2 [ObjCBreakBeforeNestedBlockParam] Category=1 -Description="Break parameters list into lines when there is nested block parameters in a fuction 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;
          }]
          }
          " +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 @@ -857,6 +913,17 @@ 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." @@ -893,6 +960,15 @@ TrueFalse="SortIncludes: true|SortIncludes: false" Value=1 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="If true, clang-format will sort using declarations.

          The order of using declarations is 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.

          false:                                 true:
          using std::cout; vs. using std::cin;
          using std::cin; using std::cout;
          " @@ -925,6 +1001,15 @@ 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;
          " @@ -933,6 +1018,14 @@ TrueFalse="SpaceBeforeAssignmentOperators: true|SpaceBeforeAssignmentOperators: 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 };
          " @@ -1066,6 +1159,15 @@ Choices="Standard: c++03|Standard: c++11|Standard: c++14|Standard: c++17|Standar 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" diff --git a/readme.html b/readme.html index f2d6068..2ffd62b 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

          Features

          • Artistic Styler
          • BCPP
          • -
          • ClangFormat
          • +
          • ClangFormat
          • Cobol Beautify
          • CSSTidy
          • Fortran 90 PPR
          • From bb5afada1323b46a49228f1cdcfc72cb940a390f Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sun, 14 Nov 2021 23:44:07 +0000 Subject: [PATCH 07/11] ClangFormat v13.0.0 Incorporate changes from llvm/llvm-project 078f30e, 4ad41f1, 772eb24, a8105b3, 25f753c, 2a42c75, 6ca5281, 7b02794, 31443f8, dda978e, 8702c6d, 09b75f4, 6f605b8, 673c5ba, 64cf5eb, be9a87f, b3ccf4f, a08fa8a, 8b7881a --- README.md | 2 +- indenters/uigui_clangformat.ini | 152 +++++++++++++++++++++++++++----- readme.html | 2 +- 3 files changed, 132 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 119ecb9..576ba74 100644 --- a/README.md +++ b/README.md @@ -25,7 +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/12.0.0/tools/clang/docs/ClangFormat.html) +* [ClangFormat](https://releases.llvm.org/13.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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 3398093..3d1c1db 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -2,27 +2,27 @@ 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|*.m|*.mm|*.M|*.proto|*.cs +fileTypes=*.cpp|*.cxx|*.C|*.c|*.h|*.hpp|*.java|*.js|*.json|*.m|*.mm|*.M|*.proto|*.cs indenterFileName=clang-format -indenterName=ClangFormat (C, C++, Java, JavaScript, ObjC, ObjC++, ProtoBuf, C#) +indenterName=ClangFormat (C, C++, Java, JavaScript, JSON, ObjC, ObjC++, ProtoBuf, C#) inputFileName=indentinput inputFileParameter="-style=file -i " -manual=https://releases.llvm.org/12.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/13.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio stringparaminquotes=false showHelpParameter=-help useCfgFileParameter=none -version=12.0.0 +version=13.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: ObjC|Language: Proto|Language: TextProto|Language: TableGen|Language: CSharp" -ChoicesReadable="(Cpp) C, C++|(Java) Java|(JavaScript) JavaScript|(ObjC) Objective C, Objective C++|(Proto) Protocol Buffers|(TextProto) Protocol Buffer messages in text format|(TableGen) TableGen|(CSharp) C#" +Choices="Language: Cpp|Language: Java|Language: JavaScript|Language: Json|Language: ObjC|Language: Proto|Language: TextProto|Language: TableGen|Language: CSharp" +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#" ValueDefault=0 [BasedOnStyle] @@ -30,8 +30,8 @@ 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" -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/+/master/styleguide/styleguide.md|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(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?view=vs-2017|(GNU) GNU coding standards - https://www.gnu.org/prep/standards/standards.html" +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/+/master/styleguide/styleguide.md|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(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?view=vs-2017|(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] @@ -54,6 +54,15 @@ Choices="AlignAfterOpenBracket: Align|AlignAfterOpenBracket: DontAlign|AlignAfte 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." ValueDefault=0 +[AlignArrayOfStructures] +Category=4 +Description="(AlignArrayOfStructures) if not None, when using initialization for an array of structs aligns the fields into columns." +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="(AlignConsecutiveAssignments) Style of aligning consecutive assignments.

            Consecutive will result in formattings like:

            int a            = 1;
            int somelongname = 2;
            double c = 3;
            " @@ -176,11 +185,11 @@ ValueDefault=4 [AllowShortIfStatementsOnASingleLine] Category=1 -Description="(AllowShortIfStatementsOnASingleLine) If true, if (a) return; can be put on a single line." +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: Always" -ChoicesReadable="(Never) Never put short ifs on the same line.|(WithoutElse) Without else put short ifs on the same line only if the else is not a compound statement.|(Always) Always put short ifs on the same line if the else is not a compound statement or not." +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] @@ -478,8 +487,8 @@ Category=1 Description="(BreakInheritanceList) The inheritance list style to use." EditorType=multiple Enabled=false -Choices="BreakInheritanceList: BeforeColon|BreakInheritanceList: BeforeComma|BreakInheritanceList: AfterColon" -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." +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] @@ -580,6 +589,15 @@ 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." @@ -591,7 +609,7 @@ ValueDefault=2 [FixNamespaceComments] Category=7 -Description="If true, clang-format adds missing namespace end comments and fixes invalid existing ones.
            true:                                  false:
            namespace a { vs. namespace a {
            foo(); foo();
            } // namespace a }
            " +Description="If true, clang-format adds missing namespace end comments for short namespaces and fixes invalid existing ones. Short ones are controlled by "ShortNamespaceLines".
            true:                                  false:
            namespace a { vs. namespace a {
            foo(); foo();
            bar(); bar();
            } // namespace a }
            " EditorType=boolean TrueFalse="FixNamespaceComments: true|FixNamespaceComments: false" Value=1 @@ -606,6 +624,15 @@ 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." @@ -633,6 +660,14 @@ 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();
            }
            }
            " @@ -745,6 +780,15 @@ TrueFalse="KeepEmptyLinesAtTheStartOfBlocks: true|KeepEmptyLinesAtTheStartOfBloc 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 + [MacroBlockBegin] Category=3 Description="A regular expression matching macros that start a block." @@ -944,6 +988,26 @@ 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 + +[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.
            false:
            // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information
            /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */

            true:
            // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
            // information
            /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
            * information */
            " @@ -952,14 +1016,27 @@ TrueFalse="ReflowComments: true|ReflowComments: false" Value=1 ValueDefault=1 -[SortIncludes] +[ShortNamespaceLines] Category=7 -Description="If true, clang-format will sort #includes.
            false:                                 true:
            #include "b.h" vs. #include "a.h"
            #include "a.h" #include "b.h"
            " -EditorType=boolean -TrueFalse="SortIncludes: true|SortIncludes: false" +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." @@ -1104,10 +1181,11 @@ ValueDefault=1 [SpacesInAngles] Category=5 -Description="If true, spaces will be inserted after < and before > in template argument lists.
            true:                                  false:
            static_cast< int >(arg); vs. static_cast<int>(arg);
            std::function< void(int) > fct; std::function<void(int)> fct;
            " -EditorType=boolean -TrueFalse="SpacesInAngles: true|SpacesInAngles: false" -Value=0 +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 [SpacesInCStyleCastParentheses] @@ -1134,6 +1212,36 @@ 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
            " +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 + [SpacesInParentheses] Category=5 Description="If true, spaces will be inserted after ( and before ).
            true:                                  false:
            t f( Deleted & ) & = delete; vs. t f(Deleted &) & = delete;
            " diff --git a/readme.html b/readme.html index 2ffd62b..9eb481e 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

            Features

            • Artistic Styler
            • BCPP
            • -
            • ClangFormat
            • +
            • ClangFormat
            • Cobol Beautify
            • CSSTidy
            • Fortran 90 PPR
            • From 660b1b6364a364b0dc1dc41454053e97434ce43a Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sat, 8 Oct 2022 10:16:22 +0100 Subject: [PATCH 08/11] ClangFormat v14.0.0 Incorporate changes from llvm/llvm-project 0391165, 612048a, 8a780a2, a44ab17, 9e8fff2, 23a5090, 2c60cfc, dd3caa9, a2a826d, 931d20c, c71fbdd, 6facafe, 0c66025, 212e6c9, 80e20f9, b9e173f, 6f6f88f, da6b0d0, c2257fe, 533fbae, 966f24e, 5ea9898, 058c5df --- README.md | 2 +- indenters/uigui_clangformat.ini | 143 +++++++++++++++++++++++++++++--- readme.html | 2 +- 3 files changed, 133 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 576ba74..8995726 100644 --- a/README.md +++ b/README.md @@ -25,7 +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/13.0.0/tools/clang/docs/ClangFormat.html) +* [ClangFormat](https://releases.llvm.org/14.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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 3d1c1db..9f90e18 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -7,14 +7,14 @@ indenterFileName=clang-format indenterName=ClangFormat (C, C++, Java, JavaScript, JSON, ObjC, ObjC++, ProtoBuf, C#) inputFileName=indentinput inputFileParameter="-style=file -i " -manual=https://releases.llvm.org/13.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio stringparaminquotes=false showHelpParameter=-help useCfgFileParameter=none -version=13.0.0 +version=14.0.0 [Language] Category=0 @@ -31,7 +31,7 @@ Description="(BasedOnStyle) The style used for all options not specificall 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/+/master/styleguide/styleguide.md|(Mozilla) Mozilla’s style guide - https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style|(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?view=vs-2017|(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)." +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] @@ -50,8 +50,8 @@ 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" -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." +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 parentheses." ValueDefault=0 [AlignArrayOfStructures] @@ -135,7 +135,7 @@ ValueDefault=1 [AllowAllConstructorInitializersOnNextLine] Category=1 -Description="If a constructor definition with a member initializer list doesn’t fit on a single line, allow putting all member initializers onto the next line, if ConstructorInitializerAllOnOneLineOrOnePerLine is true. Note that this parameter has no effect if ConstructorInitializerAllOnOneLineOrOnePerLine is false.

              true:
              MyClass::MyClass() :
              member0(0), member1(2) {}

              false:
              MyClass::MyClass() :
              member0(0),
              member1(2) {}
              " +Description="This option is deprecated. See NextLine of PackConstructorInitializers." EditorType=boolean TrueFalse="AllowAllConstructorInitializersOnNextLine: true|AllowAllConstructorInitializersOnNextLine: false" Value=1 @@ -168,7 +168,7 @@ ValueDefault=0 [AllowShortEnumsOnASingleLine] Category=1 -Description="Allow short enums on a single line.
              true:
              enum { A, B } myEnum;

              false:
              enum
              {
              A,
              B
              } myEnum;
              " +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 @@ -475,7 +475,7 @@ ValueDefault=0 [BreakConstructorInitializers] Category=1 -Description="(BreakConstructorInitializers) The constructor initializers style to use." +Description="(BreakConstructorInitializers) The break constructor initializers style to use." EditorType=multiple Enabled=false Choices="BreakConstructorInitializers: BeforeColon|BreakConstructorInitializers: BeforeComma|BreakConstructorInitializers: AfterColon" @@ -529,7 +529,7 @@ ValueDefault=0 [ConstructorInitializerAllOnOneLineOrOnePerLine] Category=1 -Description="If the constructor initializers don’t fit on a line, put each initializer on its own line.
              true:
              SomeClass::Constructor()
              : aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
              return 0;
              }

              false:
              SomeClass::Constructor()
              : aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa),
              aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
              return 0;
              }
              " +Description="This option is deprecated. See CurrentLine of PackConstructorInitializers." EditorType=boolean TrueFalse="ConstructorInitializerAllOnOneLineOrOnePerLine: true|ConstructorInitializerAllOnOneLineOrOnePerLine: false" Value=0 @@ -880,6 +880,15 @@ 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" +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." +ValueDefault=1 + [PenaltyBreakAssignment] Category=1 Description="The penalty for breaking around an assignment operator." @@ -924,6 +933,17 @@ 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." @@ -999,6 +1019,24 @@ 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:

              • const
              • inline
              • static
              • constexpr
              • volatile
              • restrict
              • type
              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)." @@ -1016,6 +1054,23 @@ 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 + +[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; @@ -1132,10 +1187,74 @@ 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" -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.)" +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 + +[ - 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) {}
              " @@ -1214,7 +1333,7 @@ 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
              " +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
              " EditorType=boolean TrueFalse="SpacesInLineCommentPrefix:|SpacesInLineCommentPrefix:" Value=1 diff --git a/readme.html b/readme.html index 9eb481e..de1c8ef 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

              Features

              • Artistic Styler
              • BCPP
              • -
              • ClangFormat
              • +
              • ClangFormat
              • Cobol Beautify
              • CSSTidy
              • Fortran 90 PPR
              • From 65c339d7d64564892baf98b81bc046c930944caf Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sat, 8 Oct 2022 12:49:55 +0100 Subject: [PATCH 09/11] ClangFormat v15.0.0 Incorporate changes from llvm/llvm-project 6cd0015, 9aab0db, b786a4a, 8f310d1, 77e60bc, 5e51ace, adfe58b, 9106a07, 93b5505, c24b3db (only for AlignConsecutiveAssignments), 45cb2df, 1cd4346, 712b59c, cc55d97, b246574 --- README.md | 2 +- indenters/uigui_clangformat.ini | 123 +++++++++++++++++++++++++------- readme.html | 2 +- 3 files changed, 100 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 8995726..343e521 100644 --- a/README.md +++ b/README.md @@ -25,7 +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/14.0.0/tools/clang/docs/ClangFormat.html) +* [ClangFormat](https://releases.llvm.org/15.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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 9f90e18..0b68f62 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -4,25 +4,25 @@ 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#) +indenterName=ClangFormat (C, C++, Java, JavaScript, JSON, ObjC, ObjC++, ProtoBuf, C#, Verilog) inputFileName=indentinput inputFileParameter="-style=file -i " -manual=https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/15.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio stringparaminquotes=false showHelpParameter=-help useCfgFileParameter=none -version=14.0.0 +version=15.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" -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#" +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] @@ -56,7 +56,7 @@ ValueDefault=0 [AlignArrayOfStructures] Category=4 -Description="(AlignArrayOfStructures) if not None, when using initialization for an array of structs aligns the fields into columns." +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" @@ -65,16 +65,55 @@ ValueDefault=2 [AlignConsecutiveAssignments] Category=4 -Description="(AlignConsecutiveAssignments) Style of aligning consecutive assignments.

                Consecutive will result in formattings like:

                int a            = 1;
                int somelongname = 2;
                double c = 3;
                " -EditorType=multiple -Enabled=false -Choices="AlignConsecutiveAssignments: None|AlignConsecutiveAssignments: Consecutive|AlignConsecutiveAssignments: AcrossEmptyLines|AlignConsecutiveAssignments: AcrossComments|AlignConsecutiveAssignments: AcrossEmptyLinesAndComments" -ChoicesReadable="(None) Do not align assignments on consecutive lines.|(Consecutive) Align assignments 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." +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 field.

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

                int aaaa : 1;
                int b : 12;
                int ccc : 8;
                " +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" @@ -409,7 +448,7 @@ 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).
                int f()   vs.   int f()
                {} {
                }
                " +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 @@ -417,7 +456,7 @@ 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.
                class Foo   vs.  class Foo
                {} {
                }
                " +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 @@ -425,7 +464,7 @@ 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.
                namespace Foo   vs.  namespace Foo
                {} {
                }
                " +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 @@ -459,11 +498,12 @@ ValueDefault=0 [BreakBeforeConceptDeclarations] Category=1 -Description="If true, concept will be placed on a new line.
                true:
                template<typename T>
                concept ...

                false:
                template<typename T> concept ...
                " -EditorType=boolean -TrueFalse="BreakBeforeConceptDeclarations: true|BreakBeforeConceptDeclarations: false" -Value=1 -ValueDefault=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 penalities.|(Always) Always break before `concept`, putting it in the line after the template declaration." +ValueDefault=2 [BreakBeforeTernaryOperators] Category=1 @@ -710,13 +750,13 @@ Choices="IndentPPDirectives: None|IndentPPDirectives: AfterHash|IndentPPDirectiv ChoicesReadable="(None) Does not indent any directives.|(AfterHash) Indents directives after the hash.|(BeforeHash) Indents directives before the hash." ValueDefault=0 -[IndentRequires] +[IndentRequiresClause] Category=3 -Description="Indent the requires clause in a template
                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) {
                //....
                }
                " +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="IndentRequires: true|IndentRequires: false" -Value=0 -ValueDefault=0 +TrueFalse="IndentRequiresClause: true|IndentRequiresClause: false" +Value=1 +ValueDefault=1 [IndentWidth] Category=3 @@ -737,6 +777,14 @@ 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 + [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
                ]
                " @@ -1062,6 +1110,15 @@ TrueFalse="RemoveBracesLLVM: true|RemoveBracesLLVM: 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 + [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 {};
                }
                " @@ -1247,6 +1304,22 @@ 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();
                " diff --git a/readme.html b/readme.html index de1c8ef..0d33f8e 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

                Features

                • Artistic Styler
                • BCPP
                • -
                • ClangFormat
                • +
                • ClangFormat
                • Cobol Beautify
                • CSSTidy
                • Fortran 90 PPR
                • From a8bb96264dd567c68267bae5cba557ddc1d66bea Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sat, 30 Sep 2023 22:53:34 +0100 Subject: [PATCH 10/11] ClangFormat v16.0.0 Incorporate changes from llvm/llvm-project 2fd2f26, 961fd77, 2adf241, 95b3947, 69e7727, 231fc00, 9c422ab, 3edc121, 63a3a06, 691774d, 41a09a0, f6b2529, 40c1476, cb01bef, 7b36538, 4cafc37, ba4caec, 46c94e5, f0756e0, 89aad1e, ed4afd1, a28f074, 2c6ecc9, 879bfe6, 1b1d8ac, 922c889, d3b5634, c0a5374, b4ad387, 0d0dab4, a74bc43, 9cddd7a, e3eca33, 58751f9 `DeriveLineEnding` and `UseCRLF` are removed as they are now deprecated. --- README.md | 2 +- indenters/uigui_clangformat.ini | 168 ++++++++++++++++++++++++++------ readme.html | 2 +- 3 files changed, 139 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 343e521..ecff99c 100644 --- a/README.md +++ b/README.md @@ -25,7 +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/15.0.0/tools/clang/docs/ClangFormat.html) +* [ClangFormat](https://releases.llvm.org/16.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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 0b68f62..9cbd6c2 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -7,14 +7,14 @@ 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/15.0.0/tools/clang/docs/ClangFormatStyleOptions.html +manual=https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormatStyleOptions.html outputFileName=indentinput outputFileParameter=none parameterOrder=pio stringparaminquotes=false showHelpParameter=-help useCfgFileParameter=none -version=15.0.0 +version=16.0.0 [Language] Category=0 @@ -158,12 +158,32 @@ ValueDefault=1 [AlignTrailingComments] Category=4 -Description="Aligns trailing comments.
                  true:                                   false:
                  int a; // My comment a vs. int a; // My comment a
                  int b = 2; // comment b int b = 2; // comment about b
                  " +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: true|AlignTrailingComments: false" +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);
                  " @@ -237,7 +257,7 @@ Description="(AllowShortLambdasOnASingleLine) Dependent on the value, 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." @@ -505,6 +542,15 @@ Choices="BreakBeforeConceptDeclarations: Never|BreakBeforeConceptDeclarations: A 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 penalities.|(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;
                  " @@ -605,14 +651,6 @@ TrueFalse="Cpp11BracedListStyle: true|Cpp11BracedListStyle: false" Value=1 ValueDefault=1 -[DeriveLineEnding] -Category=7 -Description="Analyze the formatted file for the most used line ending (\r\n or \n). UseCRLF is only used as a fallback if none can be derived." -EditorType=boolean -TrueFalse="DeriveLineEnding: true|DeriveLineEnding: false" -Value=0 -ValueDefault=0 - [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." @@ -649,7 +687,7 @@ ValueDefault=2 [FixNamespaceComments] Category=7 -Description="If true, clang-format adds missing namespace end comments for short namespaces and fixes invalid existing ones. Short ones are controlled by "ShortNamespaceLines".
                  true:                                  false:
                  namespace a { vs. namespace a {
                  foo(); foo();
                  bar(); bar();
                  } // namespace a }
                  " +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 @@ -785,6 +823,14 @@ 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
                  ]
                  " @@ -794,6 +840,47 @@ 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
                  " +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 + +[ - Decimal] +Category=7 +Description="Format separators in decimal literals." +EditorType=numeric +Enabled=false +CallName=" Decimal: " +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 + [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;
                  " @@ -837,6 +924,15 @@ 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." @@ -1078,7 +1174,7 @@ ValueDefault=0 [QualifierOrder] Category=7 -Description="The order in which the qualifiers appear.

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

                  • const
                  • inline
                  • static
                  • constexpr
                  • volatile
                  • restrict
                  • type
                  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." +Description="The order in which the qualifiers appear.

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

                  • const
                  • inline
                  • static
                  • friend
                  • constexpr
                  • volatile
                  • restrict
                  • type
                  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 @@ -1096,7 +1192,7 @@ ValueDefault=0 [ReflowComments] Category=1 -Description="If true, clang-format will attempt to re-flow comments.
                  false:
                  // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information
                  /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */

                  true:
                  // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
                  // information
                  /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
                  * information */
                  " +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 @@ -1110,6 +1206,14 @@ TrueFalse="RemoveBracesLLVM: true|RemoveBracesLLVM: false" Value=0 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) " @@ -1119,6 +1223,15 @@ Choices="RequiresClausePosition: OwnLine|RequiresClausePosition: WithPreceding|R 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 {};
                  }
                  " @@ -1160,11 +1273,12 @@ ValueDefault=0 [SortUsingDeclarations] Category=7 -Descriptions="If true, clang-format will sort using declarations.

                  The order of using declarations is 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.

                  false:                                 true:
                  using std::cout; vs. using std::cin;
                  using std::cin; using std::cout;
                  " -EditorType=boolean -TrueFalse="SortUsingDeclarations: true|SortUsingDeclarations: false" -Value=1 -ValueDefault=1 +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 @@ -1406,7 +1520,7 @@ 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
                  " +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 @@ -1497,14 +1611,6 @@ Enabled=false Value="[]" ValueDefault="[]" -[UseCRLF] -Category=7 -Description="Use \r\n instead of \n for line breaks. Also used as fallback if DeriveLineEnding is true." -EditorType=boolean -TrueFalse="UseCRLF: true|UseCRLF: false" -Value=0 -ValueDefault=0 - [UseTab] Category=3 Description="(UseTab) The way to use tab characters in the resulting file." diff --git a/readme.html b/readme.html index 0d33f8e..f572eb3 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

                  Features

                  • Artistic Styler
                  • BCPP
                  • -
                  • ClangFormat
                  • +
                  • ClangFormat
                  • Cobol Beautify
                  • CSSTidy
                  • Fortran 90 PPR
                  • From a8fd0f7bd9471f6c695b132dc08559181246133c Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Sun, 1 Oct 2023 00:07:43 +0100 Subject: [PATCH 11/11] ClangFormat v17.0.0 Incorporate changes from llvm/llvm-project 25e2d0f, 4f37de9, c24cdd5, 7a5b957, 7c92820, b94175b, af98f3b, 253985d, 74cc438, 5c614bd, 8385ee0, 64ae766, c12aa69, 2db0812, 369e876, 10518fe, aed7959, d2627cf, b6a7180, 829ed96, f6d557e, 413a7cb, 9ec5dc6, 3a6a070, 5c106f7, 8f54b83, 4ba0084, 4f093b3, ac6e551, 87ad34f, 74720d1, c669541 `SpaceInEmptyParentheses`, `SpacesInCStyleCastParentheses`, `SpacesInConditionalStatement` and `SpacesInParentheses` are removed as they are now deprecated. --- README.md | 2 +- indenters/uigui_clangformat.ini | 234 ++++++++++++++++++++++++++------ readme.html | 2 +- 3 files changed, 195 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index ecff99c..3545b52 100644 --- a/README.md +++ b/README.md @@ -25,7 +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/16.0.0/tools/clang/docs/ClangFormat.html) +* [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/) diff --git a/indenters/uigui_clangformat.ini b/indenters/uigui_clangformat.ini index 9cbd6c2..abf16d1 100644 --- a/indenters/uigui_clangformat.ini +++ b/indenters/uigui_clangformat.ini @@ -7,14 +7,14 @@ 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/16.0.0/tools/clang/docs/ClangFormatStyleOptions.html +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=16.0.0 +version=17.0.0 [Language] Category=0 @@ -51,12 +51,12 @@ Description="(AlignAfterOpenBracket) Horizontally aligns arguments after a 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 parentheses." +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.

                    " +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" @@ -138,6 +138,46 @@ Choices="AlignConsecutiveMacros: None|AlignConsecutiveMacros: Consecutive|AlignC 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." @@ -158,7 +198,7 @@ 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
                    " +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 @@ -396,7 +436,7 @@ ValueDefault=0 [ - AfterObjCDeclaration] Category=2 -Description="Wrap ObjC definitions (interfaces, implementations…). @autoreleasepool and @synchronized blocks are wrapped according to AfterControlStatement flag." +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 @@ -490,6 +530,17 @@ 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." @@ -509,7 +560,7 @@ 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
                    ]
                    " +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 @@ -539,7 +590,7 @@ Description="(BreakBeforeConceptDeclarations) The concept declaration styl 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 penalities.|(Always) Always break before `concept`, putting it in the line after the template declaration." +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] @@ -842,7 +893,7 @@ 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
                    " +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 @@ -859,6 +910,17 @@ 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." @@ -870,6 +932,17 @@ 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." @@ -881,6 +954,17 @@ 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;
                    " @@ -907,6 +991,14 @@ 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(); }
                    }
                    " @@ -951,6 +1043,15 @@ 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:

                    • Both function-like macros and object-like macros are supported.
                    • Macro arguments must be used exactly once in the expansion.
                    • No recursive expansion; macros referencing other macros will be ignored.
                    • Overloading by arity is supported: for example, given the macro definitions A=x, A()=y, A(a)=a
                      A; -> x;
                      A(); -> y;
                      A(z); -> z;
                      A(a, b); // will not be expanded.

                    " +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;
              }" @@ -1029,8 +1130,8 @@ Category=1 Description="(PackConstructorInitializers) The pack constructor initializers style to use." EditorType=multiple Enabled=false -Choices="PackConstructorInitializers: Never|PackConstructorInitializers: BinPack|PackConstructorInitializers: CurrentLine|PackConstructorInitializers: NextLine" -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." +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] @@ -1174,7 +1275,7 @@ ValueDefault=0 [QualifierOrder] Category=7 -Description="The order in which the qualifiers appear.

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

              • const
              • inline
              • static
              • friend
              • constexpr
              • volatile
              • restrict
              • type
              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." +Description="The order in which the qualifiers appear.

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

              • const
              • inline
              • static
              • friend
              • constexpr
              • volatile
              • restrict
              • type

              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 @@ -1206,6 +1307,15 @@ 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;
              }; }
              " @@ -1353,6 +1463,14 @@ 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." @@ -1466,17 +1584,9 @@ TrueFalse="SpaceInEmptyBlock: true|SpaceInEmptyBlock: false" Value=0 ValueDefault=0 -[SpaceInEmptyParentheses] -Category=5 -Description="If true, spaces may be inserted into ().
              true:                                false:
              void f( ) { vs. void f() {
              int x[] = {foo( ), bar( )}; int x[] = {foo(), bar()};
              if (true) { if (true) {
              f( ); f();
              } }
              } }
              " -EditorType=boolean -TrueFalse="SpaceInEmptyParentheses: true|SpaceInEmptyParentheses: 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.

              SpacesBeforeTrailingComments: 3
              void f() {
              if (true) { // foo1
              f(); // bar
              } // foo
              }
              " +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: " @@ -1494,25 +1604,9 @@ 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 -[SpacesInCStyleCastParentheses] -Category=5 -Description="If true, spaces may be inserted into C style casts.
              true:                                  false:
              x = ( int32 )y vs. x = (int32)y
              " -EditorType=boolean -TrueFalse="SpacesInCStyleCastParentheses: true|SpacesInCStyleCastParentheses: false" -Value=0 -ValueDefault=0 - -[SpacesInConditionalStatement] -Category=5 -Description="If true, spaces will be inserted around if/for/switch/while conditions.
              true:                                  false:
              if ( a ) { ... } vs. if (a) { ... }
              while ( i < 5 ) { ... } while (i < 5) { ... }
              " -EditorType=boolean -TrueFalse="SpacesInConditionalStatement: true|SpacesInConditionalStatement: false" -Value=0 -ValueDefault=0 - [SpacesInContainerLiterals] Category=5 -Description="If true, spaces are inserted inside container literals (e.g. ObjC and Javascript array and dict literals).
              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});
              " +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 @@ -1548,11 +1642,51 @@ MinVal=-1 Value=-1 ValueDefault=-1 -[SpacesInParentheses] +[SpacesInParens] +Category=5 +Description="Defines in which cases spaces will be inserted after ( and before ).

              Possible values:

              • Never
                Never put a space in parentheses.
              • Custom
                Configure each individual space in parentheses in SpacesInParensOptions.

              " +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="If true, spaces will be inserted after ( and before ).
              true:                                  false:
              t f( Deleted & ) & = delete; vs. t f(Deleted &) & = delete;
              " +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="SpacesInParentheses: true|SpacesInParentheses: false" +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 @@ -1602,6 +1736,16 @@ 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." @@ -1620,6 +1764,14 @@ Choices="UseTab: Never|UseTab: ForIndentation|UseTab: ForContinuationAndIndentat 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." diff --git a/readme.html b/readme.html index f572eb3..197bd9e 100644 --- a/readme.html +++ b/readme.html @@ -63,7 +63,7 @@

              Features