|
clang 24.0.0git
|
The FormatStyle is used to configure the formatting to follow specific guidelines. More...
#include "clang/Format/Format.h"
Classes | |
| struct | AlignConsecutiveStyle |
| Alignment options. More... | |
| struct | BinaryOperationBreakRule |
| A rule that specifies how to break a specific set of binary operators. More... | |
| struct | BraceWrappingFlags |
| Precise control over the wrapping of braces. More... | |
| struct | BreakBinaryOperationsOptions |
| Options for BreakBinaryOperations. More... | |
| struct | FormatStyleSet |
| struct | IntegerLiteralSeparatorStyle |
| Separator format of integer literals of different bases. More... | |
| struct | KeepEmptyLinesStyle |
| Options regarding which empty lines are kept. More... | |
| struct | NumericLiteralCaseStyle |
| Separate control for each numeric literal component. More... | |
| struct | PackArgumentsStyle |
| Options related to packing arguments of function calls. More... | |
| struct | PackParametersStyle |
| Options related to packing parameters of function declarations and definitions. More... | |
| struct | RawStringFormat |
| See documentation of RawStringFormats. More... | |
| struct | ShortCaseStatementsAlignmentStyle |
| Alignment options. More... | |
| struct | ShortFunctionStyle |
| Different styles for merging short functions containing at most one statement. More... | |
| struct | SortIncludesOptions |
| Includes sorting options. More... | |
| struct | SpaceBeforeParensCustom |
| Precise control over the spacing before parentheses. More... | |
| struct | SpacesInLineComment |
| If true, spaces may be inserted into C style casts. More... | |
| struct | SpacesInParensCustom |
| Precise control over the spacing in parentheses. More... | |
| struct | TrailingCommentsAlignmentStyle |
| Alignment options. More... | |
Public Types | |
| enum | ArrayInitializerAlignmentStyle : int8_t { AIAS_Left , AIAS_Right , AIAS_None } |
| Different style for aligning array initializers. More... | |
| enum | EscapedNewlineAlignmentStyle : int8_t { ENAS_DontAlign , ENAS_Left , ENAS_LeftWithLastLine , ENAS_Right } |
| Different styles for aligning escaped newlines. More... | |
| enum | OperandAlignmentStyle : int8_t { OAS_DontAlign , OAS_Align , OAS_AlignAfterOperator } |
| Different styles for aligning operands. More... | |
| enum | TrailingCommentsAlignmentKinds : int8_t { TCAS_Leave , TCAS_Always , TCAS_Never } |
| Enums for AlignTrailingComments. More... | |
| enum | BreakBeforeNoexceptSpecifierStyle : int8_t { BBNSS_Never , BBNSS_OnlyWithParen , BBNSS_Always } |
| Different ways to break before a noexcept specifier. More... | |
| enum | ShortBlockStyle : int8_t { SBS_Never , SBS_Empty , SBS_Always } |
| Different styles for merging short blocks containing at most one statement. More... | |
| enum | ShortIfStyle : int8_t { SIS_Never , SIS_WithoutElse , SIS_OnlyFirstIf , SIS_AllIfsAndElse } |
| Different styles for handling short if statements. More... | |
| enum | ShortLambdaStyle : int8_t { SLS_None , SLS_Empty , SLS_Inline , SLS_All } |
| Different styles for merging short lambdas containing at most one statement. More... | |
| enum | ShortRecordStyle : int8_t { SRS_Never , SRS_EmptyAndAttached , SRS_Empty , SRS_Always } |
| Different styles for merging short records (class,struct, and union). More... | |
| enum | DefinitionReturnTypeBreakingStyle : int8_t { DRTBS_None , DRTBS_All , DRTBS_TopLevel } |
| Different ways to break after the function definition return type. More... | |
| enum | ReturnTypeBreakingStyle : int8_t { RTBS_None , RTBS_Automatic , RTBS_ExceptShortType , RTBS_All , RTBS_TopLevel , RTBS_AllDefinitions , RTBS_TopLevelDefinitions } |
| Different ways to break after the function definition or declaration return type. More... | |
| enum | BreakTemplateDeclarationsStyle : int8_t { BTDS_Leave , BTDS_No , BTDS_MultiLine , BTDS_Yes } |
| Different ways to break after the template declaration. More... | |
| enum | BitFieldColonSpacingStyle : int8_t { BFCS_Both , BFCS_None , BFCS_Before , BFCS_After } |
| This option is deprecated. More... | |
| enum | BraceWrappingAfterControlStatementStyle : int8_t { BWACS_Never , BWACS_MultiLine , BWACS_Always } |
| Different ways to wrap braces after control statements. More... | |
| enum | AttributeBreakingStyle : int8_t { ABS_Always , ABS_Leave , ABS_LeaveAll , ABS_Never } |
| Different ways to break after the last attribute of a group before a declaration or control statement. More... | |
| enum | BinPackStyle : int8_t { BPS_Auto , BPS_Always , BPS_Never } |
| The style of wrapping parameters on the same line (bin-packed) or on one line each. More... | |
| enum | BinaryOperatorStyle : int8_t { BOS_None , BOS_NonAssignment , BOS_All } |
| The style of breaking before or after binary operators. More... | |
| enum | BraceBreakingStyle : int8_t { BS_Attach , BS_Linux , BS_Mozilla , BS_Stroustrup , BS_Allman , BS_Whitesmiths , BS_GNU , BS_WebKit , BS_Custom } |
| Different ways to attach braces to their surrounding context. More... | |
| enum | BreakBeforeConceptDeclarationsStyle : int8_t { BBCDS_Never , BBCDS_Allowed , BBCDS_Always } |
| Different ways to break before concept declarations. More... | |
| enum | BreakBeforeInlineASMColonStyle : int8_t { BBIAS_Never , BBIAS_OnlyMultiline , BBIAS_Always } |
| Different ways to break ASM parameters. More... | |
| enum | BreakBeforeReturnTypeStyle : int8_t { BBRTS_None , BBRTS_All , BBRTS_TopLevel , BBRTS_AllDefinitions , BBRTS_TopLevelDefinitions } |
| Different ways to break before the function return type. More... | |
| enum | BreakBinaryOperationsStyle : int8_t { BBO_Never , BBO_OnePerLine , BBO_RespectPrecedence } |
| Different ways to break binary operations. More... | |
| enum | BreakConstructorInitializersStyle : int8_t { BCIS_BeforeColon , BCIS_BeforeComma , BCIS_AfterColon , BCIS_AfterComma } |
| Different ways to break initializers. More... | |
| enum | BreakInheritanceListStyle : int8_t { BILS_BeforeColon , BILS_BeforeComma , BILS_AfterColon , BILS_AfterComma } |
| Different ways to break inheritance list. More... | |
| enum | BracedListStyle : int8_t { BLS_Block , BLS_FunctionCall , BLS_AlignFirstComment } |
| Different ways to handle braced lists. More... | |
| enum | EmptyLineAfterAccessModifierStyle : int8_t { ELAAMS_Never , ELAAMS_Leave , ELAAMS_Always } |
| Different styles for empty line after access modifiers. More... | |
| enum | EmptyLineBeforeAccessModifierStyle : int8_t { ELBAMS_Never , ELBAMS_Leave , ELBAMS_LogicalBlock , ELBAMS_Always } |
| Different styles for empty line before access modifiers. More... | |
| enum | EnumTrailingCommaStyle : int8_t { ETC_Leave , ETC_Insert , ETC_Remove } |
| Styles for enum trailing commas. More... | |
| enum | IndentExternBlockStyle : int8_t { IEBS_AfterExternBlock , IEBS_NoIndent , IEBS_Indent } |
| Indents extern blocks. More... | |
| enum | IndentGotoLabelStyle : int8_t { IGLS_NoIndent , IGLS_OuterIndent , IGLS_InnerIndent , IGLS_HalfIndent } |
| Options for indenting goto labels. More... | |
| enum | PPDirectiveIndentStyle : int8_t { PPDIS_None , PPDIS_AfterHash , PPDIS_BeforeHash , PPDIS_Leave } |
| Options for indenting preprocessor directives. More... | |
| enum | TrailingCommaStyle : int8_t { TCS_None , TCS_Wrapped } |
| The style of inserting trailing commas into container literals. More... | |
| enum | JavaScriptQuoteStyle : int8_t { JSQS_Leave , JSQS_Single , JSQS_Double } |
| Quotation styles for JavaScript strings. More... | |
| enum | LambdaBodyIndentationKind : int8_t { LBI_Signature , LBI_OuterScope } |
| Indentation logic for lambda bodies. More... | |
| enum | LanguageKind : int8_t { LK_None , LK_C , LK_Cpp , LK_CSharp , LK_Java , LK_JavaScript , LK_Json , LK_ObjC , LK_Proto , LK_TableGen , LK_TextProto , LK_Verilog } |
| Supported languages. More... | |
| enum | LineEndingStyle : int8_t { LE_LF , LE_CRLF , LE_DeriveLF , LE_DeriveCRLF } |
| Line ending style. More... | |
| enum | NamespaceIndentationKind : int8_t { NI_None , NI_Inner , NI_All } |
| Different ways to indent namespace contents. More... | |
| enum | NumericLiteralComponentStyle : int8_t { NLCS_Leave , NLCS_Upper , NLCS_Lower } |
| Control over each component in a numeric literal. More... | |
| enum | BinPackArgumentsStyle : int8_t { BPAS_BinPack , BPAS_OnePerLine , BPAS_UseBreakAfter } |
| Different ways to try to fit all arguments on a line. More... | |
| enum | PackConstructorInitializersStyle : int8_t { PCIS_Never , PCIS_BinPack , PCIS_CurrentLine , PCIS_NextLine , PCIS_NextLineOnly } |
| Different ways to try to fit all constructor initializers on a line. More... | |
| enum | BinPackParametersStyle : int8_t { BPPS_BinPack , BPPS_OnePerLine , BPPS_AlwaysOnePerLine , BPPS_UseBreakAfter } |
| Different ways to try to fit all parameters on a line. More... | |
| enum | PointerAlignmentStyle : int8_t { PAS_Left , PAS_Right , PAS_Middle } |
| The &, && and * alignment style. More... | |
| enum | QualifierAlignmentStyle : int8_t { QAS_Leave , QAS_Left , QAS_Right , QAS_Custom } |
| Different specifiers and qualifiers alignment styles. More... | |
| enum | ReferenceAlignmentStyle : int8_t { RAS_Pointer , RAS_Left , RAS_Right , RAS_Middle } |
| The & and && alignment style. More... | |
| enum | ReflowCommentsStyle : int8_t { RCS_Never , RCS_IndentOnly , RCS_Always } |
| Types of comment reflow style. More... | |
| enum | RemoveParenthesesStyle : int8_t { RPS_Leave , RPS_MultipleParentheses , RPS_ReturnStatement } |
| Types of redundant parentheses to remove. More... | |
| enum | RequiresClausePositionStyle : int8_t { RCPS_OwnLine , RCPS_OwnLineWithBrace , RCPS_WithPreceding , RCPS_WithFollowing , RCPS_SingleLine } |
| The possible positions for the requires clause. More... | |
| enum | RequiresExpressionIndentationKind : int8_t { REI_OuterScope , REI_Keyword } |
| Indentation logic for requires expression bodies. More... | |
| enum | SeparateDefinitionStyle : int8_t { SDS_Leave , SDS_Always , SDS_Never } |
| The style if definition blocks should be separated. More... | |
| enum | SortJavaStaticImportOptions : int8_t { SJSIO_Before , SJSIO_After } |
| Position for Java Static imports. More... | |
| enum | SortUsingDeclarationsOptions : int8_t { SUD_Never , SUD_Lexicographic , SUD_LexicographicNumeric } |
| Using declaration sorting options. More... | |
| enum | SpaceAroundPointerQualifiersStyle : int8_t { SAPQ_Default , SAPQ_Before , SAPQ_After , SAPQ_Both } |
| Different ways to put a space before opening parentheses. More... | |
| enum | SpaceBeforeParensStyle : int8_t { SBPO_Never , SBPO_ControlStatements , SBPO_ControlStatementsExceptControlMacros , SBPO_NonEmptyParentheses , SBPO_Always , SBPO_Custom } |
| Different ways to put a space before opening parentheses. More... | |
| enum | SpaceInEmptyBracesStyle : int8_t { SIEB_Always , SIEB_Block , SIEB_Never } |
| This option is deprecated. More... | |
| enum | SpacesInAnglesStyle : int8_t { SIAS_Never , SIAS_Always , SIAS_Leave } |
| Styles for adding spacing after < and before > in template argument lists. More... | |
| enum | SpacesInBlockCommentsStyle : int8_t { SIBCS_Never , SIBCS_Always , SIBCS_Leave } |
| Styles for controlling spacing after /* and before `. More... | |
| enum | SpacesInParensStyle : int8_t { SIPO_Never , SIPO_Custom } |
| Different ways to put a space before opening and closing parentheses. More... | |
| enum | LanguageStandard : int8_t { LS_Cpp03 , LS_Cpp11 , LS_Cpp14 , LS_Cpp17 , LS_Cpp20 , LS_Cpp23 , LS_Cpp26 , LS_Latest , LS_Auto } |
| Supported language standards for parsing and formatting C++ constructs. More... | |
| enum | DAGArgStyle : int8_t { DAS_DontBreak , DAS_BreakElements , DAS_BreakAll } |
| Different ways to control the format inside TableGen DAGArg. More... | |
| enum | UseTabStyle : int8_t { UT_Never , UT_ForIndentation , UT_ForContinuationAndIndentation , UT_AlignWithSpaces , UT_Always } |
| This option is deprecated. More... | |
| enum | WrapNamespaceBodyWithEmptyLinesStyle : int8_t { WNBWELS_Never , WNBWELS_Always , WNBWELS_Leave } |
| Different styles for wrapping namespace body with empty lines. More... | |
Public Member Functions | |
| bool | isCpp () const |
| bool | isCSharp () const |
| bool | isJson () const |
| bool | isJava () const |
| bool | isJavaScript () const |
| bool | isVerilog () const |
| bool | isTextProto () const |
| bool | isProto () const |
| bool | isTableGen () const |
| bool | operator== (const FormatStyle &R) const |
| std::optional< FormatStyle > | GetLanguageStyle (LanguageKind Language) const |
Static Public Member Functions | |
| static FormatStyleSet | BuildStyleSetFromConfiguration (const FormatStyle &MainStyle, const std::vector< FormatStyle > &ConfigurationStyles) |
Public Attributes | |
| std::string | InheritConfig |
| int | AccessModifierOffset |
| The extra indent or outdent of access modifiers, e.g. | |
| bool | AlignAfterOpenBracket |
| If true, horizontally aligns arguments after an open bracket. | |
| ArrayInitializerAlignmentStyle | AlignArrayOfStructures |
| If not None, when using initialization for an array of structs aligns the fields into columns. | |
| AlignConsecutiveStyle | AlignConsecutiveAssignments |
| Style of aligning consecutive assignments. | |
| AlignConsecutiveStyle | AlignConsecutiveBitFields |
| Style of aligning consecutive bit fields. | |
| AlignConsecutiveStyle | AlignConsecutiveDeclarations |
| Style of aligning consecutive declarations. | |
| AlignConsecutiveStyle | AlignConsecutiveMacros |
| Style of aligning consecutive macro definitions. | |
| ShortCaseStatementsAlignmentStyle | AlignConsecutiveShortCaseStatements |
| Style of aligning consecutive short case labels. | |
| AlignConsecutiveStyle | AlignConsecutiveTableGenBreakingDAGArgColons |
| Style of aligning consecutive TableGen DAGArg operator colons. | |
| AlignConsecutiveStyle | AlignConsecutiveTableGenCondOperatorColons |
| Style of aligning consecutive TableGen cond operator colons. | |
| AlignConsecutiveStyle | AlignConsecutiveTableGenDefinitionColons |
| Style of aligning consecutive TableGen definition colons. | |
| EscapedNewlineAlignmentStyle | AlignEscapedNewlines |
| Options for aligning backslashes in escaped newlines. | |
| OperandAlignmentStyle | AlignOperands |
| If true, horizontally align operands of binary and ternary expressions. | |
| TrailingCommentsAlignmentStyle | AlignTrailingComments |
| Control of trailing comments. | |
| bool | AllowAllArgumentsOnNextLine |
| 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. | |
| bool | AllowAllParametersOfDeclarationOnNextLine |
| This option is deprecated. | |
| BreakBeforeNoexceptSpecifierStyle | AllowBreakBeforeNoexceptSpecifier |
| Controls if there could be a line break before a noexcept specifier. | |
| bool | AllowBreakBeforeQtProperty |
| Allow breaking before Q_Property keywords READ, WRITE, etc. | |
| ShortBlockStyle | AllowShortBlocksOnASingleLine |
| Dependent on the value, while (true) { continue; } can be put on a single line. | |
| bool | AllowShortCaseExpressionOnASingleLine |
| Whether to merge a short switch labeled rule into a single line. | |
| bool | AllowShortCaseLabelsOnASingleLine |
| If true, short case labels will be contracted to a single line. | |
| bool | AllowShortCompoundRequirementOnASingleLine |
| Allow short compound requirement on a single line. | |
| bool | AllowShortEnumsOnASingleLine |
| Allow short enums on a single line. | |
| ShortFunctionStyle | AllowShortFunctionsOnASingleLine |
| Dependent on the value, int f() { return 0; } can be put on a single line. | |
| ShortIfStyle | AllowShortIfStatementsOnASingleLine |
| Dependent on the value, if (a) return; can be put on a single line. | |
| ShortLambdaStyle | AllowShortLambdasOnASingleLine |
| Dependent on the value, auto lambda []() { return 0; } can be put on a single line. | |
| bool | AllowShortLoopsOnASingleLine |
| If true, while (true) continue; can be put on a single line. | |
| bool | AllowShortNamespacesOnASingleLine |
| If true, namespace a { class b; } can be put on a single line. | |
| ShortRecordStyle | AllowShortRecordOnASingleLine |
| Dependent on the value, struct bar { int i; }; can be put on a single line. | |
| DefinitionReturnTypeBreakingStyle | AlwaysBreakAfterDefinitionReturnType |
| The function definition return type breaking style to use. | |
| bool | AlwaysBreakBeforeMultilineStrings |
| This option is renamed to BreakAfterReturnType. | |
| std::vector< std::string > | AttributeMacros |
| This option is renamed to BreakTemplateDeclarations. | |
| bool | BinPackLongBracedList |
| This option is deprecated. | |
| BitFieldColonSpacingStyle | BitFieldColonSpacing |
| The BitFieldColonSpacingStyle to use for bitfields. | |
| int | BracedInitializerIndentWidth |
| The number of columns to use to indent the contents of braced init lists. | |
| BraceWrappingFlags | BraceWrapping |
| Control of individual brace wrapping cases. | |
| bool | BreakAdjacentStringLiterals |
| Break between adjacent string literals. | |
| AttributeBreakingStyle | BreakAfterAttributes |
| Break after a group of C++11 attributes before variable or function (including constructor/destructor) declaration/definition names or before control statements, i.e. | |
| bool | BreakAfterOpenBracketBracedList |
| Force break after the left bracket of a braced initializer list (when Cpp11BracedListStyle is true) when the list exceeds the column limit. | |
| bool | BreakAfterOpenBracketFunction |
| Force break after the left parenthesis of a function (declaration, definition, call) when the parameters exceed the column limit. | |
| bool | BreakAfterOpenBracketIf |
| Force break after the left parenthesis of an if control statement when the expression exceeds the column limit. | |
| bool | BreakAfterOpenBracketLoop |
| Force break after the left parenthesis of a loop control statement when the expression exceeds the column limit. | |
| bool | BreakAfterOpenBracketSwitch |
| Force break after the left parenthesis of a switch control statement when the expression exceeds the column limit. | |
| ReturnTypeBreakingStyle | BreakAfterReturnType |
| The function declaration return type breaking style to use. | |
| bool | BreakArrays |
| 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). | |
| BinaryOperatorStyle | BreakBeforeBinaryOperators |
| The way to wrap binary operators. | |
| BraceBreakingStyle | BreakBeforeBraces |
| The brace breaking style to use. | |
| bool | BreakBeforeCloseBracketBracedList |
| Force break before the right bracket of a braced initializer list (when Cpp11BracedListStyle is true) when the list exceeds the column limit. | |
| bool | BreakBeforeCloseBracketFunction |
| Force break before the right parenthesis of a function (declaration, definition, call) when the parameters exceed the column limit. | |
| bool | BreakBeforeCloseBracketIf |
| Force break before the right parenthesis of an if control statement when the expression exceeds the column limit. | |
| bool | BreakBeforeCloseBracketLoop |
| Force break before the right parenthesis of a loop control statement when the expression exceeds the column limit. | |
| bool | BreakBeforeCloseBracketSwitch |
| Force break before the right parenthesis of a switch control statement when the expression exceeds the column limit. | |
| BreakBeforeConceptDeclarationsStyle | BreakBeforeConceptDeclarations |
| The concept declaration style to use. | |
| BreakBeforeInlineASMColonStyle | BreakBeforeInlineASMColon |
| The inline ASM colon style to use. | |
| BreakBeforeReturnTypeStyle | BreakBeforeReturnType |
| The function declaration/definition return type breaking style to use. | |
| bool | BreakBeforeTemplateCloser |
| If true, break before a template closing bracket (>) when there is a line break after the matching opening bracket (<). | |
| bool | BreakBeforeTernaryOperators |
| If true, ternary operators will be placed after line breaks. | |
| BreakBinaryOperationsOptions | BreakBinaryOperations |
| The break binary operations style to use. | |
| BreakConstructorInitializersStyle | BreakConstructorInitializers |
| The break constructor initializers style to use. | |
| bool | BreakFunctionDeclarationParameters |
| If true, clang-format will always break before function declaration parameters. | |
| bool | BreakFunctionDefinitionParameters |
| If true, clang-format will always break before function definition parameters. | |
| bool | BreakAfterJavaFieldAnnotations |
| Break after each annotation on a field in Java files. | |
| bool | BreakStringLiterals |
| Allow breaking string literals when formatting. | |
| unsigned | ColumnLimit |
| The column limit. | |
| std::string | CommentPragmas |
| A regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed. | |
| BreakInheritanceListStyle | BreakInheritanceList |
| The inheritance list style to use. | |
| BreakTemplateDeclarationsStyle | BreakTemplateDeclarations |
| The template declaration breaking style to use. | |
| bool | CompactNamespaces |
| If true, consecutive namespace declarations will be on the same line. | |
| unsigned | ConstructorInitializerIndentWidth |
| This option is deprecated. | |
| unsigned | ContinuationIndentWidth |
| Indent width for line continuations. | |
| BracedListStyle | Cpp11BracedListStyle |
| The style to handle braced lists. | |
| bool | DerivePointerAlignment |
| This option is deprecated. | |
| bool | DisableFormat |
| Disables formatting completely. | |
| EmptyLineAfterAccessModifierStyle | EmptyLineAfterAccessModifier |
| Defines when to put an empty line after access modifiers. | |
| EmptyLineBeforeAccessModifierStyle | EmptyLineBeforeAccessModifier |
| Defines in which cases to put empty line before access modifiers. | |
| EnumTrailingCommaStyle | EnumTrailingComma |
| Insert a comma (if missing) or remove the comma at the end of an enum enumerator list. | |
| bool | ExperimentalAutoDetectBinPacking |
| If true, clang-format detects whether function calls and definitions are formatted with one parameter per line. | |
| bool | FixNamespaceComments |
| If true, clang-format adds missing namespace end comments for namespaces and fixes invalid existing ones. | |
| std::vector< std::string > | ForEachMacros |
| A vector of macros that should be interpreted as foreach loops instead of as function calls. | |
| tooling::IncludeStyle | IncludeStyle |
| std::vector< std::string > | IfMacros |
| A vector of macros that should be interpreted as conditionals instead of as function calls. | |
| bool | IndentAccessModifiers |
| Specify whether access modifiers should have their own indentation level. | |
| bool | IndentCaseBlocks |
| Indent case label blocks one level from the case label. | |
| bool | IndentCaseLabels |
| Indent case labels one level from the switch statement. | |
| bool | IndentExportBlock |
| If true, clang-format will indent the body of an export { ... } block. | |
| IndentExternBlockStyle | IndentExternBlock |
| IndentExternBlockStyle is the type of indenting of extern blocks. | |
| IndentGotoLabelStyle | IndentGotoLabels |
| The goto label indenting style to use. | |
| PPDirectiveIndentStyle | IndentPPDirectives |
| The preprocessor directive indenting style to use. | |
| bool | IndentRequiresClause |
| Indent the requires clause in a template. | |
| unsigned | IndentWidth |
| The number of columns to use for indentation. | |
| bool | IndentWrappedFunctionNames |
| Indent if a function definition or declaration is wrapped after the type. | |
| bool | InsertBraces |
| 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. | |
| bool | InsertNewlineAtEOF |
| Insert a newline at end of file if missing. | |
| TrailingCommaStyle | InsertTrailingCommas |
| If set to TCS_Wrapped will insert trailing commas in container literals (arrays and objects) that wrap across multiple lines. | |
| IntegerLiteralSeparatorStyle | IntegerLiteralSeparator |
| Format integer literal separators (‘’ for C/C++ and _` for C#, Java, and JavaScript). | |
| std::vector< std::string > | JavaImportGroups |
| A vector of prefixes ordered by the desired groups for Java imports. | |
| JavaScriptQuoteStyle | JavaScriptQuotes |
| The JavaScriptQuoteStyle to use for JavaScript strings. | |
| bool | JavaScriptWrapImports |
| Whether to wrap JavaScript import/export statements. | |
| KeepEmptyLinesStyle | KeepEmptyLines |
| Which empty lines are kept. | |
| bool | KeepFormFeed |
| This option is deprecated. | |
| LambdaBodyIndentationKind | LambdaBodyIndentation |
| The indentation style of lambda bodies. | |
| LanguageKind | Language |
| The language that this format style targets. | |
| LineEndingStyle | LineEnding |
| Line ending style (\n or \r\n) to use. | |
| std::string | MacroBlockBegin |
| A regular expression matching macros that start a block. | |
| std::string | MacroBlockEnd |
| A regular expression matching macros that end a block. | |
| std::vector< std::string > | Macros |
A list of macros of the form <definition>=<expansion> . | |
| std::vector< std::string > | MacrosSkippedByRemoveParentheses |
| A vector of function-like macros whose invocations should be skipped by RemoveParentheses. | |
| unsigned | MaxEmptyLinesToKeep |
| The maximum number of consecutive empty lines to keep. | |
| NamespaceIndentationKind | NamespaceIndentation |
| The indentation used for namespaces. | |
| std::vector< std::string > | NamespaceMacros |
| A vector of macros which are used to open namespace blocks. | |
| NumericLiteralCaseStyle | NumericLiteralCase |
| Capitalization style for numeric literals. | |
| BinPackStyle | ObjCBinPackProtocolList |
| Controls bin-packing Objective-C protocol conformance list items into as few lines as possible when they go over ColumnLimit. | |
| unsigned | ObjCBlockIndentWidth |
| The number of characters to use for indentation of ObjC blocks. | |
| bool | ObjCBreakBeforeNestedBlockParam |
| Break parameters list into lines when there is nested block parameters in a function call. | |
| std::vector< std::string > | ObjCPropertyAttributeOrder |
| The order in which ObjC property attributes should appear. | |
| bool | ObjCSpaceAfterMethodDeclarationPrefix |
| Add or remove a space between the '-'/'+' and the return type in Objective-C method declarations. | |
| bool | ObjCSpaceAfterProperty |
| Add a space after @property in Objective-C, i.e. | |
| bool | ObjCSpaceBeforeProtocolList |
| Add a space in front of an Objective-C protocol list, i.e. | |
| std::string | OneLineFormatOffRegex |
| A regular expression that describes markers for turning formatting off for one line. | |
| PackArgumentsStyle | PackArguments |
| Options related to packing arguments of function calls. | |
| PackConstructorInitializersStyle | PackConstructorInitializers |
| The pack constructor initializers style to use. | |
| PackParametersStyle | PackParameters |
| Options related to packing parameters of function declarations and definitions. | |
| unsigned | PenaltyBreakAssignment |
| The penalty for breaking around an assignment operator. | |
| unsigned | PenaltyBreakBeforeFirstCallParameter |
| The penalty for breaking a function call after call(. | |
| unsigned | PenaltyBreakBeforeMemberAccess |
| The penalty for breaking before a member access operator (.
| |
| unsigned | PenaltyBreakComment |
| The penalty for each line break introduced inside a comment. | |
| unsigned | PenaltyBreakFirstLessLess |
| The penalty for breaking before the first <<. | |
| unsigned | PenaltyBreakOpenParenthesis |
| The penalty for breaking after (. | |
| unsigned | PenaltyBreakScopeResolution |
| The penalty for breaking after ::. | |
| unsigned | PenaltyBreakString |
| The penalty for each line break introduced inside a string literal. | |
| unsigned | PenaltyBreakTemplateDeclaration |
| The penalty for breaking after template declaration. | |
| unsigned | PenaltyExcessCharacter |
| The penalty for each character outside of the column limit. | |
| unsigned | PenaltyIndentedWhitespace |
| Penalty for each character of whitespace indentation (counted relative to leading non-whitespace column). | |
| unsigned | PenaltyReturnTypeOnItsOwnLine |
| Penalty for putting the return type of a function onto its own line. | |
| PointerAlignmentStyle | PointerAlignment |
| Pointer and reference alignment style. | |
| int | PPIndentWidth |
| The number of columns to use for indentation of preprocessor statements. | |
| QualifierAlignmentStyle | QualifierAlignment |
| Different ways to arrange specifiers and qualifiers (e.g. | |
| std::vector< std::string > | QualifierOrder |
| The order in which the qualifiers appear. | |
| std::vector< RawStringFormat > | RawStringFormats |
| Defines hints for detecting supported languages code blocks in raw strings. | |
| ReferenceAlignmentStyle | ReferenceAlignment |
| Reference alignment style (overrides PointerAlignment for references). | |
| ReflowCommentsStyle | ReflowComments |
| Comment reformatting style. | |
| bool | RemoveBracesLLVM |
| Remove optional braces of control statements (if, else, for, and while) in C++ according to the LLVM coding style. | |
| bool | RemoveEmptyLinesInUnwrappedLines |
| Remove empty lines within unwrapped lines. | |
| RemoveParenthesesStyle | RemoveParentheses |
| Remove redundant parentheses. | |
| bool | RemoveSemicolon |
| Remove semicolons after the closing braces of functions and constructors/destructors. | |
| RequiresClausePositionStyle | RequiresClausePosition |
| The position of the requires clause. | |
| RequiresExpressionIndentationKind | RequiresExpressionIndentation |
| The indentation used for requires expression bodies. | |
| SeparateDefinitionStyle | SeparateDefinitionBlocks |
| Specifies the use of empty lines to separate definition blocks, including classes, structs, enums, and functions. | |
| unsigned | ShortNamespaceLines |
| The maximal number of unwrapped lines that a short namespace spans. | |
| bool | SkipMacroDefinitionBody |
| Do not format macro definition body. | |
| SortIncludesOptions | SortIncludes |
| Controls if and how clang-format will sort #includes. | |
| SortJavaStaticImportOptions | SortJavaStaticImport |
| When sorting Java imports, by default static imports are placed before non-static imports. | |
| SortUsingDeclarationsOptions | SortUsingDeclarations |
| Controls if and how clang-format will sort using declarations. | |
| bool | SpaceAfterCStyleCast |
| If true, a space is inserted after C style casts. | |
| bool | SpaceAfterLogicalNot |
| If true, a space is inserted after the logical not operator (!). | |
| bool | SpaceAfterOperatorKeyword |
| If true, a space will be inserted after the operator keyword. | |
| bool | SpaceAfterTemplateKeyword |
If true, a space will be inserted after the template keyword. | |
| SpaceAroundPointerQualifiersStyle | SpaceAroundPointerQualifiers |
| Defines in which cases to put a space before or after pointer qualifiers. | |
| bool | SpaceBeforeAssignmentOperators |
| If false, spaces will be removed before assignment operators. | |
| bool | SpaceBeforeCaseColon |
| If false, spaces will be removed before case colon. | |
| bool | SpaceBeforeCpp11BracedList |
| If true, a space will be inserted before a C++11 braced list used to initialize an object (after the preceding identifier or type). | |
| bool | SpaceBeforeCtorInitializerColon |
| If false, spaces will be removed before constructor initializer colon. | |
| bool | SpaceBeforeEnumUnderlyingTypeColon |
| If false, spaces will be removed before enum underlying type colon. | |
| bool | SpaceBeforeInheritanceColon |
| If false, spaces will be removed before inheritance colon. | |
| bool | SpaceBeforeJsonColon |
| If true, a space will be added before a JSON colon. | |
| SpaceBeforeParensStyle | SpaceBeforeParens |
| Defines in which cases to put a space before opening parentheses. | |
| SpaceBeforeParensCustom | SpaceBeforeParensOptions |
| Control of individual space before parentheses. | |
| bool | SpaceBeforeSquareBrackets |
| If true, spaces will be before [. | |
| bool | SpaceBeforeRangeBasedForLoopColon |
| If false, spaces will be removed before range-based for loop colon. | |
| SpaceInEmptyBracesStyle | SpaceInEmptyBraces |
| Specifies when to insert a space in empty braces. | |
| unsigned | SpacesBeforeTrailingComments |
| If true, spaces may be inserted into (). | |
| SpacesInAnglesStyle | SpacesInAngles |
| The SpacesInAnglesStyle to use for template argument lists. | |
| and *and parameter comments ending | with |
| The SpacesInBlockCommentsStyle to use for ordinary block comments. | |
| bool | SpacesInContainerLiterals |
| If true, spaces will be inserted around if/for/switch/while conditions. | |
| SpacesInLineComment | SpacesInLineCommentPrefix |
| How many spaces are allowed at the start of a line comment. | |
| SpacesInParensStyle | SpacesInParens |
| If true, spaces will be inserted after ( and before ). | |
| SpacesInParensCustom | SpacesInParensOptions |
| Control of individual spaces in parentheses. | |
| bool | SpacesInSquareBrackets |
| If true, spaces will be inserted after [ and before ]. | |
| LanguageStandard | Standard |
| Parse and format C++ constructs compatible with this standard. | |
| std::vector< std::string > | StatementAttributeLikeMacros |
| Macros which are ignored in front of a statement, as if they were an attribute. | |
| std::vector< std::string > | StatementMacros |
| A vector of macros that should be interpreted as complete statements. | |
| std::vector< std::string > | TableGenBreakingDAGArgOperators |
| Works only when TableGenBreakInsideDAGArg is not DontBreak. | |
| DAGArgStyle | TableGenBreakInsideDAGArg |
| The styles of the line break inside the DAGArg in TableGen. | |
| unsigned | TabWidth |
| The number of columns used for tab stops. | |
| std::vector< std::string > | TemplateNames |
| A vector of non-keyword identifiers that should be interpreted as template names. | |
| std::vector< std::string > | TypeNames |
| A vector of non-keyword identifiers that should be interpreted as type names. | |
| std::vector< std::string > | TypenameMacros |
| A vector of macros that should be interpreted as type declarations instead of as function calls. | |
| UseTabStyle | UseTab |
| The way to use tab characters in the resulting file. | |
| std::vector< std::string > | VariableTemplates |
| A vector of non-keyword identifiers that should be interpreted as variable template names. | |
| bool | VerilogBreakBetweenInstancePorts |
| For Verilog, put each port on its own line in module instantiations. | |
| std::vector< std::string > | WhitespaceSensitiveMacros |
| A vector of macros which are whitespace-sensitive and should not be touched. | |
| WrapNamespaceBodyWithEmptyLinesStyle | WrapNamespaceBodyWithEmptyLines |
| Wrap namespace body with empty lines. | |
Friends | |
| std::error_code | parseConfiguration (llvm::MemoryBufferRef Config, FormatStyle *Style, bool AllowUnknownOptions=false, llvm::SourceMgr::DiagHandlerTy DiagHandler=nullptr, void *DiagHandlerCtxt=nullptr, bool IsDotHFile=false) |
| Parse configuration from YAML-formatted text. | |
The FormatStyle is used to configure the formatting to follow specific guidelines.
Different style for aligning array initializers.
Different ways to break after the last attribute of a group before a declaration or control statement.
The style of breaking before or after binary operators.
Different ways to try to fit all arguments on a line.
Different ways to try to fit all parameters on a line.
This option is deprecated.
See BinPack of PackParameters.
Different ways to attach braces to their surrounding context.
| Enumerator | |
|---|---|
| BS_Attach | Always attach braces to surrounding context. namespace N {
enum E {
E1,
E2,
};
class C {
public:
C();
};
bool baz(int i) {
try {
do {
switch (i) {
case 1: {
foobar();
break;
}
default: {
break;
}
}
} while (--i);
return true;
} catch (...) {
handleError();
return false;
}
}
void foo(bool b) {
if (b) {
baz(2);
} else {
baz(5);
}
}
void bar() { foo(true); }
} // namespace N
|
| BS_Linux | Like Attach, but break before braces on function, namespace and class definitions. namespace N
{
enum E {
E1,
E2,
};
class C
{
public:
C();
};
bool baz(int i)
{
try {
do {
switch (i) {
case 1: {
foobar();
break;
}
default: {
break;
}
}
} while (--i);
return true;
} catch (...) {
handleError();
return false;
}
}
void foo(bool b)
{
if (b) {
baz(2);
} else {
baz(5);
}
}
void bar() { foo(true); }
} // namespace N
|
| BS_Mozilla | Like Attach, but break before braces on enum, function, and record definitions. namespace N {
enum E
{
E1,
E2,
};
class C
{
public:
C();
};
bool baz(int i)
{
try {
do {
switch (i) {
case 1: {
foobar();
break;
}
default: {
break;
}
}
} while (--i);
return true;
} catch (...) {
handleError();
return false;
}
}
void foo(bool b)
{
if (b) {
baz(2);
} else {
baz(5);
}
}
void bar() { foo(true); }
} // namespace N
|
| BS_Stroustrup | Like Attach, but break before function definitions, catch, and else. namespace N {
enum E {
E1,
E2,
};
class C {
public:
C();
};
bool baz(int i)
{
try {
do {
switch (i) {
case 1: {
foobar();
break;
}
default: {
break;
}
}
} while (--i);
return true;
}
catch (...) {
handleError();
return false;
}
}
void foo(bool b)
{
if (b) {
baz(2);
}
else {
baz(5);
}
}
void bar() { foo(true); }
} // namespace N
|
| BS_Allman | Always break before braces. namespace N
{
enum E
{
E1,
E2,
};
class C
{
public:
C();
};
bool baz(int i)
{
try
{
do
{
switch (i)
{
case 1:
{
foobar();
break;
}
default:
{
break;
}
}
} while (--i);
return true;
}
catch (...)
{
handleError();
return false;
}
}
void foo(bool b)
{
if (b)
{
baz(2);
}
else
{
baz(5);
}
}
void bar() { foo(true); }
} // namespace N
|
| BS_Whitesmiths | Like Allman but always indent braces and line up code with braces. namespace N
{
enum E
{
E1,
E2,
};
class C
{
public:
C();
};
bool baz(int i)
{
try
{
do
{
switch (i)
{
case 1:
{
foobar();
break;
}
default:
{
break;
}
}
} while (--i);
return true;
}
catch (...)
{
handleError();
return false;
}
}
void foo(bool b)
{
if (b)
{
baz(2);
}
else
{
baz(5);
}
}
void bar() { foo(true); }
} // namespace N
|
| BS_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. namespace N
{
enum E
{
E1,
E2,
};
class C
{
public:
C();
};
bool baz(int i)
{
try
{
do
{
switch (i)
{
case 1:
{
foobar();
break;
}
default:
{
break;
}
}
}
while (--i);
return true;
}
catch (...)
{
handleError();
return false;
}
}
void foo(bool b)
{
if (b)
{
baz(2);
}
else
{
baz(5);
}
}
void bar() { foo(true); }
} // namespace N
|
| BS_WebKit | Like Attach, but break before functions. namespace N {
enum E {
E1,
E2,
};
class C {
public:
C();
};
bool baz(int i)
{
try {
do {
switch (i) {
case 1: {
foobar();
break;
}
default: {
break;
}
}
} while (--i);
return true;
} catch (...) {
handleError();
return false;
}
}
void foo(bool b)
{
if (b) {
baz(2);
} else {
baz(5);
}
}
void bar() { foo(true); }
} // namespace N
|
| BS_Custom | Configure each individual brace in BraceWrapping. |
Different ways to handle braced lists.
| Enumerator | |
|---|---|
| BLS_Block | Best suited for pre C++11 braced lists.
vector<int> x{ 1, 2, 3, 4 };
vector<T> x{ {}, {}, {}, {} };
f(MyMap[{ composite, key }]);
new int[3]{ 1, 2, 3 };
value
};
RangeSelector name(std::string ID) Given a node with a "name", (like NamedDecl, DeclRefExpr, CxxCtorInitializer, and TypeLoc) selects th... Definition RangeSelector.cpp:250 |
| BLS_FunctionCall | Best suited for C++11 braced lists.
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. |
| BLS_AlignFirstComment | Same as FunctionCall, except for the handling of a comment at the begin, it then aligns everything following with the comment.
|
Different ways to wrap braces after control statements.
Different ways to break before concept declarations.
| Enumerator | |
|---|---|
| BBCDS_Never | Keep the template declaration line together with concept. |
| BBCDS_Allowed | Breaking between template declaration and concept is allowed. The actual behavior depends on the content and line breaking rules and penalties. |
| BBCDS_Always | Always break before concept, putting it in the line after the template declaration. template <typename T>
concept C = ...;
|
Different ways to break ASM parameters.
Different ways to break before a noexcept specifier.
Different ways to break before the function return type.
Different ways to break binary operations.
Different ways to break initializers.
| Enumerator | |
|---|---|
| BCIS_BeforeColon | Break constructor initializers before the colon and after the commas. : initializer1(),
initializer2()
|
| BCIS_BeforeComma | Break constructor initializers before the colon and commas, and align the commas with the colon. |
| BCIS_AfterColon | Break constructor initializers after the colon and commas. |
| BCIS_AfterComma | Break constructor initializers only after the commas. Constructor() : initializer1(),
initializer2()
|
Different ways to break inheritance list.
Different ways to break after the template declaration.
Different ways to control the format inside TableGen DAGArg.
| Enumerator | |
|---|---|
| DAS_DontBreak | Never break inside DAGArg. let DAGArgIns = (ins i32:$src1, i32:$src2);
|
| DAS_BreakElements | Break inside DAGArg after each list element but for the last. This aligns to the first element. let DAGArgIns = (ins i32:$src1,
i32:$src2);
|
| DAS_BreakAll | Break inside DAGArg after the operator and the all elements. let DAGArgIns = (ins
i32:$src1,
i32:$src2
);
|
Different ways to break after the function definition return type.
This option is deprecated and is retained for backwards compatibility.
Different styles for empty line after access modifiers.
EmptyLineBeforeAccessModifier configuration handles the number of empty lines between two access modifiers.
Different styles for empty line before access modifiers.
Styles for enum trailing commas.
Different styles for aligning escaped newlines.
Indents extern blocks.
| Enumerator | |
|---|---|
| IEBS_AfterExternBlock | Backwards compatible with AfterExternBlock's indenting. IndentExternBlock: AfterExternBlock
BraceWrapping.AfterExternBlock: true
extern "C"
{
void foo();
}
IndentExternBlockStyle IndentExternBlock IndentExternBlockStyle is the type of indenting of extern blocks. Definition Format.h:3284 IndentExternBlock: AfterExternBlock
BraceWrapping.AfterExternBlock: false
extern "C" {
void foo();
}
|
| IEBS_NoIndent | Does not indent extern blocks. extern "C" {
void foo();
}
|
| IEBS_Indent | Indents extern blocks. extern "C" {
void foo();
}
|
Options for indenting goto labels.
Quotation styles for JavaScript strings.
Does not affect template strings.
Indentation logic for lambda bodies.
| Enumerator | |
|---|---|
| LBI_Signature | Align lambda body relative to the lambda signature. This is the default. someMethod(
[](SomeReallyLongLambdaSignatureArgument foo) {
return;
});
|
| LBI_OuterScope | For statements within block scope, align lambda body relative to the indentation level of the outer scope the lambda signature resides in. someMethod(
[](SomeReallyLongLambdaSignatureArgument foo) {
return;
});
someMethod(someOtherMethod(
[](SomeReallyLongLambdaSignatureArgument foo) {
return;
}));
|
Supported languages.
When stored in a configuration file, specifies the language, that the configuration targets. When passed to the reformat() function, enables syntax features specific to the language.
| Enumerator | |
|---|---|
| LK_None | Do not use. |
| LK_C | Should be used for C. |
| LK_Cpp | Should be used for C++. |
| LK_CSharp | Should be used for C#. |
| LK_Java | Should be used for Java. |
| LK_JavaScript | Should be used for JavaScript. |
| LK_Json | Should be used for JSON. |
| LK_ObjC | Should be used for Objective-C, Objective-C++. |
| LK_Proto | Should be used for Protocol Buffers |
| LK_TableGen | Should be used for TableGen code. |
| LK_TextProto | Should be used for Protocol Buffer messages in text format. |
| LK_Verilog | Should be used for Verilog and SystemVerilog. https://standards.ieee.org/ieee/1800/6700/ https://sci-hub.st/10.1109/IEEESTD.2018.8299595 |
Supported language standards for parsing and formatting C++ constructs.
The correct way to spell a specific language version is e.g. c++11. The historical aliases Cpp03 and Cpp11 are deprecated.
Different styles for aligning operands.
| Enumerator | |
|---|---|
| OAS_DontAlign | Do not align operands of binary and ternary expressions. The wrapped lines are indented ContinuationIndentWidth spaces from the start of the line. |
| OAS_Align | 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;
When BreakBeforeBinaryOperators is set, the wrapped operator is aligned with the operand on the first line. int aaa = bbbbbbbbbbbbbbb
+ ccccccccccccccc;
|
| OAS_AlignAfterOperator | Horizontally align operands of binary and ternary expressions. This is similar to OAS_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. int aaa = bbbbbbbbbbbbbbb
+ ccccccccccccccc;
|
Different ways to try to fit all constructor initializers on a line.
| Enumerator | |
|---|---|
| PCIS_Never | Always put each constructor initializer on its own line. |
| PCIS_BinPack | Bin-pack constructor initializers. |
| PCIS_CurrentLine | Put all constructor initializers on the current line if they fit. Otherwise, put each one on its own line. |
| PCIS_NextLine | Same as PCIS_CurrentLine except that if all constructor initializers do not fit on the current line, try to fit them on the next line. Constructor() : a(), b()
: aaaaaaaaaaaaaaaaaaaa(), bbbbbbbbbbbbbbbbbbbb(), ddddddddddddd()
: aaaaaaaaaaaaaaaaaaaa(),
bbbbbbbbbbbbbbbbbbbb(),
cccccccccccccccccccc()
|
| PCIS_NextLineOnly | Put all constructor initializers on the next line if they fit. Otherwise, put each one on its own line. : a(), b()
: aaaaaaaaaaaaaaaaaaaa(), bbbbbbbbbbbbbbbbbbbb(), ddddddddddddd()
: aaaaaaaaaaaaaaaaaaaa(),
bbbbbbbbbbbbbbbbbbbb(),
cccccccccccccccccccc()
|
Options for indenting preprocessor directives.
Different specifiers and qualifiers alignment styles.
Types of comment reflow style.
Types of redundant parentheses to remove.
The possible positions for the requires clause.
The IndentRequires option is only used if the requires is put on the start of a line.
| Enumerator | |
|---|---|
| RCPS_OwnLine | Always put the requires clause on its own line (possibly followed by a semicolon). |
| RCPS_OwnLineWithBrace | As with OwnLine, except, unless otherwise prohibited, place a following open brace (of a function definition) to follow on the same line. |
| RCPS_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. |
| RCPS_WithFollowing | Try to put the requires clause together with the class or function declaration. |
| RCPS_SingleLine | Try to put everything in the same line if possible. Otherwise normal line breaking rules take over. // Fitting:
// Not fitting, one possible example:
template <typename LongName>
requires C<LongName>
struct Foo {...
template <typename LongName>
requires C<LongName>
void bar(LongName ln) {
template <typename LongName>
void bar(LongName ln)
requires C<LongName> {
|
Indentation logic for requires expression bodies.
| Enumerator | |
|---|---|
| REI_OuterScope | Align requires expression body relative to the indentation level of the outer scope the requires expression resides in. This is the default. |
| REI_Keyword | Align requires expression body relative to the requires keyword. |
Different ways to break after the function definition or declaration return type.
| Enumerator | |
|---|---|
| RTBS_None | This is deprecated. See Automatic below. |
| RTBS_Automatic | Break after return type based on PenaltyReturnTypeOnItsOwnLine. class A {
int f() { return 0; };
};
int f();
int f() { return 1; }
int
LongName::AnotherLongName();
|
| RTBS_ExceptShortType | Same as Automatic above, except that there is no break after short return types. class A {
int f() { return 0; };
};
int f();
int f() { return 1; }
int LongName::
AnotherLongName();
|
| RTBS_All | Always break after the return type. class A {
int
f() {
return 0;
};
};
int
f();
int
f() {
return 1;
}
int
LongName::AnotherLongName();
|
| RTBS_TopLevel | Always break after the return types of top-level functions. class A {
int f() { return 0; };
};
int
f();
int
f() {
return 1;
}
int
LongName::AnotherLongName();
|
| RTBS_AllDefinitions | Always break after the return type of function definitions. class A {
int
f() {
return 0;
};
};
int f();
int
f() {
return 1;
}
int
LongName::AnotherLongName();
|
| RTBS_TopLevelDefinitions | Always break after the return type of top-level definitions. class A {
int f() { return 0; };
};
int f();
int
f() {
return 1;
}
int
LongName::AnotherLongName();
|
Different styles for merging short blocks containing at most one statement.
Different styles for handling short if statements.
Different styles for merging short lambdas containing at most one statement.
Different styles for merging short records (class,struct, and union).
Position for Java Static imports.
Using declaration sorting options.
Different ways to put a space before opening parentheses.
| Enumerator | |
|---|---|
| SAPQ_Default | Don't ensure spaces around pointer qualifiers and use PointerAlignment instead. PointerAlignment: Left PointerAlignment: Right
PointerAlignmentStyle PointerAlignment Pointer and reference alignment style. Definition Format.h:4491 |
| SAPQ_Before | Ensure that there is a space before pointer qualifiers. PointerAlignment: Left PointerAlignment: Right
|
| SAPQ_After | Ensure that there is a space after pointer qualifiers. PointerAlignment: Left PointerAlignment: Right
|
| SAPQ_Both | Ensure that there is a space both before and after pointer qualifiers. PointerAlignment: Left PointerAlignment: Right
|
Different ways to put a space before opening parentheses.
| Enumerator | |
|---|---|
| SBPO_Never | This is deprecated and replaced by Custom below, with all SpaceBeforeParensOptions but AfterPlacementOperator set to false. |
| SBPO_ControlStatements | Put a space before opening parentheses only after control statement keywords (for/if/while...). void f() {
if (true) {
f();
}
}
|
| SBPO_ControlStatementsExceptControlMacros | Same as SBPO_ControlStatements except this option doesn't apply to ForEach and If macros. This is useful in projects where ForEach/If macros are treated as function calls instead of control statements. SBPO_ControlStatementsExceptForEachMacros remains an alias for backward compatibility. void f() {
Q_FOREACH(...) {
f();
}
}
|
| SBPO_NonEmptyParentheses | Put a space before opening parentheses only if the parentheses are not empty. void() {
if (true) {
f();
g (x, y, z);
}
}
|
| SBPO_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.) void f () {
if (true) {
f ();
}
}
|
| SBPO_Custom | Configure each individual space before parentheses in SpaceBeforeParensOptions. |
This option is deprecated.
See Block of SpaceInEmptyBraces.
Styles for adding spacing after < and before > in template argument lists.
| Enumerator | |
|---|---|
| SIAS_Never | Remove spaces after < and before >. static_cast<int>(arg);
std::function<void(int)> fct;
|
| SIAS_Always | Add spaces after < and before >. static_cast< int >(arg);
std::function< void(int) > fct;
|
| SIAS_Leave | Keep a single space after < and before > if any spaces were present. Option Standard: Cpp03 takes precedence. |
The style of inserting trailing commas into container literals.
Enums for AlignTrailingComments.
This option is deprecated.
See LF and CRLF of LineEnding.
Different styles for wrapping namespace body with empty lines.
|
static |
| std::optional< FormatStyle > clang::format::FormatStyle::GetLanguageStyle | ( | FormatStyle::LanguageKind | Language | ) | const |
Definition at line 2629 of file Format.cpp.
References Language.
Referenced by clang::format::RawStringFormatStyleManager::RawStringFormatStyleManager().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 3848 of file Format.h.
References Language, and LK_JavaScript.
Referenced by clang::format::internal::reformat().
|
inline |
|
inline |
Definition at line 3851 of file Format.h.
References isTextProto(), Language, and LK_Proto.
|
inline |
Definition at line 3852 of file Format.h.
References Language, and LK_TableGen.
|
inline |
Definition at line 3850 of file Format.h.
References Language, and LK_TextProto.
Referenced by isProto().
|
inline |
Definition at line 3849 of file Format.h.
References Language, and LK_Verilog.
|
inline |
Definition at line 6079 of file Format.h.
References AccessModifierOffset, AlignAfterOpenBracket, AlignArrayOfStructures, AlignConsecutiveAssignments, AlignConsecutiveBitFields, AlignConsecutiveDeclarations, AlignConsecutiveMacros, AlignConsecutiveShortCaseStatements, AlignConsecutiveTableGenBreakingDAGArgColons, AlignConsecutiveTableGenCondOperatorColons, AlignConsecutiveTableGenDefinitionColons, AlignEscapedNewlines, AlignOperands, AlignTrailingComments, AllowAllArgumentsOnNextLine, AllowAllParametersOfDeclarationOnNextLine, AllowBreakBeforeNoexceptSpecifier, AllowBreakBeforeQtProperty, AllowShortBlocksOnASingleLine, AllowShortCaseExpressionOnASingleLine, AllowShortCaseLabelsOnASingleLine, AllowShortCompoundRequirementOnASingleLine, AllowShortEnumsOnASingleLine, AllowShortFunctionsOnASingleLine, AllowShortIfStatementsOnASingleLine, AllowShortLambdasOnASingleLine, AllowShortLoopsOnASingleLine, AllowShortNamespacesOnASingleLine, AllowShortRecordOnASingleLine, AlwaysBreakBeforeMultilineStrings, AttributeMacros, BinPackLongBracedList, BitFieldColonSpacing, BracedInitializerIndentWidth, BreakAdjacentStringLiterals, BreakAfterAttributes, BreakAfterJavaFieldAnnotations, BreakAfterOpenBracketBracedList, BreakAfterOpenBracketFunction, BreakAfterOpenBracketIf, BreakAfterOpenBracketLoop, BreakAfterOpenBracketSwitch, BreakAfterReturnType, BreakArrays, BreakBeforeBinaryOperators, BreakBeforeBraces, BreakBeforeCloseBracketBracedList, BreakBeforeCloseBracketFunction, BreakBeforeCloseBracketIf, BreakBeforeCloseBracketLoop, BreakBeforeCloseBracketSwitch, BreakBeforeConceptDeclarations, BreakBeforeInlineASMColon, BreakBeforeReturnType, BreakBeforeTemplateCloser, BreakBeforeTernaryOperators, BreakBinaryOperations, BreakConstructorInitializers, BreakFunctionDeclarationParameters, BreakFunctionDefinitionParameters, BreakInheritanceList, BreakStringLiterals, BreakTemplateDeclarations, ColumnLimit, CommentPragmas, CompactNamespaces, ConstructorInitializerIndentWidth, ContinuationIndentWidth, Cpp11BracedListStyle, DerivePointerAlignment, DisableFormat, EmptyLineAfterAccessModifier, EmptyLineBeforeAccessModifier, EnumTrailingComma, ExperimentalAutoDetectBinPacking, FixNamespaceComments, ForEachMacros, IncludeStyle, IndentAccessModifiers, IndentCaseBlocks, IndentCaseLabels, IndentExportBlock, IndentExternBlock, IndentGotoLabels, IndentPPDirectives, IndentRequiresClause, IndentWidth, IndentWrappedFunctionNames, InsertBraces, InsertNewlineAtEOF, IntegerLiteralSeparator, JavaImportGroups, JavaScriptQuotes, JavaScriptWrapImports, KeepEmptyLines, KeepFormFeed, LambdaBodyIndentation, Language, LineEnding, MacroBlockBegin, MacroBlockEnd, Macros, MacrosSkippedByRemoveParentheses, MaxEmptyLinesToKeep, NamespaceIndentation, NamespaceMacros, NumericLiteralCase, ObjCBinPackProtocolList, ObjCBlockIndentWidth, ObjCBreakBeforeNestedBlockParam, ObjCPropertyAttributeOrder, ObjCSpaceAfterMethodDeclarationPrefix, ObjCSpaceAfterProperty, ObjCSpaceBeforeProtocolList, OneLineFormatOffRegex, PackArguments, PackConstructorInitializers, PackParameters, PenaltyBreakAssignment, PenaltyBreakBeforeFirstCallParameter, PenaltyBreakBeforeMemberAccess, PenaltyBreakComment, PenaltyBreakFirstLessLess, PenaltyBreakOpenParenthesis, PenaltyBreakScopeResolution, PenaltyBreakString, PenaltyBreakTemplateDeclaration, PenaltyExcessCharacter, PenaltyReturnTypeOnItsOwnLine, PointerAlignment, QualifierAlignment, QualifierOrder, RawStringFormats, ReferenceAlignment, RemoveBracesLLVM, RemoveEmptyLinesInUnwrappedLines, RemoveParentheses, RemoveSemicolon, RequiresClausePosition, RequiresExpressionIndentation, SeparateDefinitionBlocks, ShortNamespaceLines, SkipMacroDefinitionBody, SortIncludes, SortJavaStaticImport, SpaceAfterCStyleCast, SpaceAfterLogicalNot, SpaceAfterOperatorKeyword, SpaceAfterTemplateKeyword, SpaceAroundPointerQualifiers, SpaceBeforeAssignmentOperators, SpaceBeforeCaseColon, SpaceBeforeCpp11BracedList, SpaceBeforeCtorInitializerColon, SpaceBeforeInheritanceColon, SpaceBeforeJsonColon, SpaceBeforeParens, SpaceBeforeParensOptions, SpaceBeforeRangeBasedForLoopColon, SpaceBeforeSquareBrackets, SpaceInEmptyBraces, SpacesBeforeTrailingComments, SpacesInAngles, SpacesInContainerLiterals, SpacesInLineCommentPrefix, SpacesInParens, SpacesInParensOptions, SpacesInSquareBrackets, Standard, StatementAttributeLikeMacros, StatementMacros, TableGenBreakingDAGArgOperators, TableGenBreakInsideDAGArg, TabWidth, TemplateNames, TypenameMacros, TypeNames, UseTab, VariableTemplates, VerilogBreakBetweenInstancePorts, WhitespaceSensitiveMacros, and WrapNamespaceBodyWithEmptyLines.
|
friend |
Parse configuration from YAML-formatted text.
Style->Language is used to get the base style, if the BasedOnStyle option is present.
The FormatStyleSet of Style is reset.
When BasedOnStyle is not present, options not present in the YAML document, are retained in Style.
If AllowUnknownOptions is true, no errors are emitted if unknown format options are occurred.
If set all diagnostics are emitted through the DiagHandler.
Definition at line 2491 of file Format.cpp.
References clang::format::BinPackTrailingCommaConflict, BPAS_BinPack, BPAS_UseBreakAfter, clang::format::Error, Language, LK_C, LK_Cpp, LK_None, clang::format::make_error_code(), QAS_Leave, clang::format::Success, TCS_None, clang::format::Unsuitable, and clang::format::validateQualifierOrder().
Referenced by clang::format::getStyle(), and clang::format::loadAndParseConfigFile().
| int clang::format::FormatStyle::AccessModifierOffset |
The extra indent or outdent of access modifiers, e.g.
public:.
Definition at line 64 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AlignAfterOpenBracket |
If true, horizontally aligns arguments after an open bracket.
This applies to round brackets (parentheses), angle brackets and square brackets.
Definition at line 87 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| ArrayInitializerAlignmentStyle clang::format::FormatStyle::AlignArrayOfStructures |
If not None, when using initialization for an array of structs aligns the fields into columns.
Definition at line 123 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| AlignConsecutiveStyle clang::format::FormatStyle::AlignConsecutiveAssignments |
Style of aligning consecutive assignments.
Consecutive will result in formattings like:
Definition at line 286 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| AlignConsecutiveStyle clang::format::FormatStyle::AlignConsecutiveBitFields |
Style of aligning consecutive bit fields.
Consecutive will align the bitfield separators of consecutive lines. This will result in formattings like:
Definition at line 298 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| AlignConsecutiveStyle clang::format::FormatStyle::AlignConsecutiveDeclarations |
Style of aligning consecutive declarations.
Consecutive will align the declaration names of consecutive lines. This will result in formattings like:
Definition at line 310 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| AlignConsecutiveStyle clang::format::FormatStyle::AlignConsecutiveMacros |
Style of aligning consecutive macro definitions.
Consecutive will result in formattings like:
Definition at line 323 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| ShortCaseStatementsAlignmentStyle clang::format::FormatStyle::AlignConsecutiveShortCaseStatements |
Style of aligning consecutive short case labels.
Only applies if AllowShortCaseExpressionOnASingleLine or AllowShortCaseLabelsOnASingleLine is true.
Definition at line 439 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| AlignConsecutiveStyle clang::format::FormatStyle::AlignConsecutiveTableGenBreakingDAGArgColons |
Style of aligning consecutive TableGen DAGArg operator colons.
If enabled, align the colon inside DAGArg which have line break inside. This works only when TableGenBreakInsideDAGArg is BreakElements or BreakAll and the DAGArg is not excepted by TableGenBreakingDAGArgOperators's effect.
Definition at line 454 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| AlignConsecutiveStyle clang::format::FormatStyle::AlignConsecutiveTableGenCondOperatorColons |
Style of aligning consecutive TableGen cond operator colons.
Align the colons of cases inside !cond operators.
Definition at line 464 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| AlignConsecutiveStyle clang::format::FormatStyle::AlignConsecutiveTableGenDefinitionColons |
Style of aligning consecutive TableGen definition colons.
This aligns the inheritance colons of consecutive definitions.
Definition at line 474 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| EscapedNewlineAlignmentStyle clang::format::FormatStyle::AlignEscapedNewlines |
Options for aligning backslashes in escaped newlines.
Definition at line 515 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| OperandAlignmentStyle clang::format::FormatStyle::AlignOperands |
If true, horizontally align operands of binary and ternary expressions.
Definition at line 554 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| TrailingCommentsAlignmentStyle clang::format::FormatStyle::AlignTrailingComments |
Control of trailing comments.
The alignment stops at closing braces after a line break, and only followed by other closing braces, a (do-) while, a lambda call, or a semicolon.
Definition at line 651 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowAllArgumentsOnNextLine |
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.
Definition at line 668 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowAllParametersOfDeclarationOnNextLine |
This option is deprecated.
See NextLine of PackConstructorInitializers.
Definition at line 691 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| BreakBeforeNoexceptSpecifierStyle clang::format::FormatStyle::AllowBreakBeforeNoexceptSpecifier |
Controls if there could be a line break before a noexcept specifier.
Definition at line 732 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowBreakBeforeQtProperty |
Allow breaking before Q_Property keywords READ, WRITE, etc.
as if they were preceded by a comma (,). This allows them to be formatted according to BinPackParameters.
Definition at line 738 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| ShortBlockStyle clang::format::FormatStyle::AllowShortBlocksOnASingleLine |
Dependent on the value, while (true) { continue; } can be put on a single line.
Definition at line 771 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowShortCaseExpressionOnASingleLine |
Whether to merge a short switch labeled rule into a single line.
Definition at line 784 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowShortCaseLabelsOnASingleLine |
If true, short case labels will be contracted to a single line.
Definition at line 798 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowShortCompoundRequirementOnASingleLine |
Allow short compound requirement on a single line.
Definition at line 817 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowShortEnumsOnASingleLine |
Allow short enums on a single line.
Definition at line 831 of file Format.h.
Referenced by clang::format::getLLVMStyle(), operator==(), and clang::format::internal::reformat().
| ShortFunctionStyle clang::format::FormatStyle::AllowShortFunctionsOnASingleLine |
Dependent on the value, int f() { return 0; } can be put on a single line.
Definition at line 956 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| ShortIfStyle clang::format::FormatStyle::AllowShortIfStatementsOnASingleLine |
Dependent on the value, if (a) return; can be put on a single line.
Definition at line 1027 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| ShortLambdaStyle clang::format::FormatStyle::AllowShortLambdasOnASingleLine |
Dependent on the value, auto lambda []() { return 0; } can be put on a single line.
Definition at line 1061 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowShortLoopsOnASingleLine |
If true, while (true) continue; can be put on a single line.
Definition at line 1066 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::AllowShortNamespacesOnASingleLine |
If true, namespace a { class b; } can be put on a single line.
Definition at line 1070 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| ShortRecordStyle clang::format::FormatStyle::AllowShortRecordOnASingleLine |
Dependent on the value, struct bar { int i; }; can be put on a single line.
Definition at line 1100 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| DefinitionReturnTypeBreakingStyle clang::format::FormatStyle::AlwaysBreakAfterDefinitionReturnType |
The function definition return type breaking style to use.
This option is deprecated and is retained for backwards compatibility.
Definition at line 1211 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and clang::format::getMozillaStyle().
| bool clang::format::FormatStyle::AlwaysBreakBeforeMultilineStrings |
This option is renamed to BreakAfterReturnType.
If true, always break before multiline string literals.
This flag is mean 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.
Definition at line 1231 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::AttributeMacros |
This option is renamed to BreakTemplateDeclarations.
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:
In the .clang-format configuration file, this can be configured like:
Definition at line 1301 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BinPackLongBracedList |
This option is deprecated.
See BinPack of PackArguments.
Definition at line 1321 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BitFieldColonSpacingStyle clang::format::FormatStyle::BitFieldColonSpacing |
The BitFieldColonSpacingStyle to use for bitfields.
Definition at line 1354 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| int clang::format::FormatStyle::BracedInitializerIndentWidth |
The number of columns to use to indent the contents of braced init lists.
If unset or negative, ContinuationIndentWidth is used.
Definition at line 1387 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BraceWrappingFlags clang::format::FormatStyle::BraceWrapping |
Control of individual brace wrapping cases.
If BreakBeforeBraces is set to Custom, use this to specify how each individual brace case should be handled. Otherwise, this is ignored.
Definition at line 1668 of file Format.h.
Referenced by clang::format::expandPresetsBraceWrapping(), clang::format::getLLVMStyle(), and clang::format::internal::reformat().
| bool clang::format::FormatStyle::BreakAdjacentStringLiterals |
Break between adjacent string literals.
Definition at line 1681 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| AttributeBreakingStyle clang::format::FormatStyle::BreakAfterAttributes |
Break after a group of C++11 attributes before variable or function (including constructor/destructor) declaration/definition names or before control statements, i.e.
if, switch (including case and default labels), for, and while statements.
Definition at line 1783 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakAfterJavaFieldAnnotations |
Break after each annotation on a field in Java files.
Definition at line 2714 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakAfterOpenBracketBracedList |
Force break after the left bracket of a braced initializer list (when Cpp11BracedListStyle is true) when the list exceeds the column limit.
Definition at line 1794 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakAfterOpenBracketFunction |
Force break after the left parenthesis of a function (declaration, definition, call) when the parameters exceed the column limit.
Definition at line 1804 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakAfterOpenBracketIf |
Force break after the left parenthesis of an if control statement when the expression exceeds the column limit.
Definition at line 1814 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakAfterOpenBracketLoop |
Force break after the left parenthesis of a loop control statement when the expression exceeds the column limit.
Definition at line 1824 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakAfterOpenBracketSwitch |
Force break after the left parenthesis of a switch control statement when the expression exceeds the column limit.
Definition at line 1834 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| ReturnTypeBreakingStyle clang::format::FormatStyle::BreakAfterReturnType |
The function declaration return type breaking style to use.
Definition at line 1838 of file Format.h.
Referenced by clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| bool clang::format::FormatStyle::BreakArrays |
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).
Definition at line 1857 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BinaryOperatorStyle clang::format::FormatStyle::BreakBeforeBinaryOperators |
The way to wrap binary operators.
Definition at line 1912 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| BraceBreakingStyle clang::format::FormatStyle::BreakBeforeBraces |
The brace breaking style to use.
Definition at line 2347 of file Format.h.
Referenced by clang::format::expandPresetsBraceWrapping(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| bool clang::format::FormatStyle::BreakBeforeCloseBracketBracedList |
Force break before the right bracket of a braced initializer list (when Cpp11BracedListStyle is true) when the list exceeds the column limit.
The break before the right bracket is only made if there is a break after the opening bracket.
Definition at line 2360 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakBeforeCloseBracketFunction |
Force break before the right parenthesis of a function (declaration, definition, call) when the parameters exceed the column limit.
Definition at line 2371 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakBeforeCloseBracketIf |
Force break before the right parenthesis of an if control statement when the expression exceeds the column limit.
The break before the closing parenthesis is only made if there is a break after the opening parenthesis.
Definition at line 2384 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakBeforeCloseBracketLoop |
Force break before the right parenthesis of a loop control statement when the expression exceeds the column limit.
The break before the closing parenthesis is only made if there is a break after the opening parenthesis.
Definition at line 2397 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakBeforeCloseBracketSwitch |
Force break before the right parenthesis of a switch control statement when the expression exceeds the column limit.
The break before the closing parenthesis is only made if there is a break after the opening parenthesis.
Definition at line 2410 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BreakBeforeConceptDeclarationsStyle clang::format::FormatStyle::BreakBeforeConceptDeclarations |
The concept declaration style to use.
Definition at line 2434 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BreakBeforeInlineASMColonStyle clang::format::FormatStyle::BreakBeforeInlineASMColon |
The inline ASM colon style to use.
Definition at line 2463 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BreakBeforeReturnTypeStyle clang::format::FormatStyle::BreakBeforeReturnType |
The function declaration/definition return type breaking style to use.
Trailing return types (auto f() -> T) are not affected. To have identifier macros (e.g. __always_inline) treated as specifiers, add them to AttributeMacros.
Definition at line 2488 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakBeforeTemplateCloser |
If true, break before a template closing bracket (>) when there is a line break after the matching opening bracket (<).
Definition at line 2515 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakBeforeTernaryOperators |
If true, ternary operators will be placed after line breaks.
Definition at line 2530 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| BreakBinaryOperationsOptions clang::format::FormatStyle::BreakBinaryOperations |
The break binary operations style to use.
Definition at line 2640 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BreakConstructorInitializersStyle clang::format::FormatStyle::BreakConstructorInitializers |
The break constructor initializers style to use.
Definition at line 2676 of file Format.h.
Referenced by clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| bool clang::format::FormatStyle::BreakFunctionDeclarationParameters |
If true, clang-format will always break before function declaration parameters.
Definition at line 2690 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::BreakFunctionDefinitionParameters |
If true, clang-format will always break before function definition parameters.
Definition at line 2704 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BreakInheritanceListStyle clang::format::FormatStyle::BreakInheritanceList |
The inheritance list style to use.
Definition at line 2815 of file Format.h.
Referenced by clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| bool clang::format::FormatStyle::BreakStringLiterals |
Allow breaking string literals when formatting.
In C, C++, and Objective-C:
In C# and Java:
C# interpolated strings are not broken.
In Verilog:
Definition at line 2757 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| BreakTemplateDeclarationsStyle clang::format::FormatStyle::BreakTemplateDeclarations |
The template declaration breaking style to use.
Definition at line 2819 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| unsigned clang::format::FormatStyle::ColumnLimit |
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.
Definition at line 2765 of file Format.h.
Referenced by clang::tooling::applyAtomicChanges(), clang::format::getChromiumStyle(), clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), operator==(), and clang::format::RawStringFormatStyleManager::RawStringFormatStyleManager().
| std::string clang::format::FormatStyle::CommentPragmas |
A regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed.
Definition at line 2775 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::CompactNamespaces |
If true, consecutive namespace declarations will be on the same line.
If false, each namespace is declared on a new line.
If it does not fit on a single line, the overflowing namespaces get wrapped:
Definition at line 2843 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::ConstructorInitializerIndentWidth |
This option is deprecated.
See CurrentLine of PackConstructorInitializers.
Definition at line 2853 of file Format.h.
Referenced by clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| unsigned clang::format::FormatStyle::ContinuationIndentWidth |
Indent width for line continuations.
Definition at line 2864 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| BracedListStyle clang::format::FormatStyle::Cpp11BracedListStyle |
The style to handle braced lists.
Definition at line 2926 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| bool clang::format::FormatStyle::DerivePointerAlignment |
This option is deprecated.
See DeriveLF and DeriveCRLF of LineEnding.
Definition at line 2939 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::DisableFormat |
Disables formatting completely.
Definition at line 2943 of file Format.h.
Referenced by clang::format::getLLVMStyle(), clang::format::getNoStyle(), operator==(), and clang::format::internal::reformat().
| EmptyLineAfterAccessModifierStyle clang::format::FormatStyle::EmptyLineAfterAccessModifier |
Defines when to put an empty line after access modifiers.
EmptyLineBeforeAccessModifier configuration handles the number of empty lines between two access modifiers.
Definition at line 2994 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| EmptyLineBeforeAccessModifierStyle clang::format::FormatStyle::EmptyLineBeforeAccessModifier |
Defines in which cases to put empty line before access modifiers.
Definition at line 3057 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| EnumTrailingCommaStyle clang::format::FormatStyle::EnumTrailingComma |
Insert a comma (if missing) or remove the comma at the end of an enum enumerator list.
Definition at line 3090 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::ExperimentalAutoDetectBinPacking |
If true, clang-format detects whether function calls and definitions are formatted with one parameter per line.
Each call can be bin-packed, one-per-line or inconclusive. If it is inconclusive, e.g. completely on one line, but a decision needs to be made, clang-format analyzes whether there are other bin-packed cases in the input file and act accordingly.
Definition at line 3105 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::FixNamespaceComments |
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.
Definition at line 3121 of file Format.h.
Referenced by clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::ForEachMacros |
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:
In the .clang-format configuration file, this can be configured like:
For example: BOOST_FOREACH.
Definition at line 3139 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::IfMacros |
A vector of macros that should be interpreted as conditionals instead of as function calls.
These are expected to be macros of the form:
In the .clang-format configuration file, this can be configured like:
For example: KJ_IF_MAYBE
Definition at line 3162 of file Format.h.
Referenced by clang::format::getLLVMStyle().
| tooling::IncludeStyle clang::format::FormatStyle::IncludeStyle |
Definition at line 3141 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::IndentAccessModifiers |
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.
Definition at line 3189 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::IndentCaseBlocks |
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.
Definition at line 3212 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::IndentCaseLabels |
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).
Definition at line 3231 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| bool clang::format::FormatStyle::IndentExportBlock |
If true, clang-format will indent the body of an export { ... } block.
This doesn't affect the formatting of anything else related to exported declarations.
Definition at line 3244 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| IndentExternBlockStyle clang::format::FormatStyle::IndentExternBlock |
IndentExternBlockStyle is the type of indenting of extern blocks.
Definition at line 3284 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| IndentGotoLabelStyle clang::format::FormatStyle::IndentGotoLabels |
The goto label indenting style to use.
Definition at line 3342 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| PPDirectiveIndentStyle clang::format::FormatStyle::IndentPPDirectives |
The preprocessor directive indenting style to use.
Definition at line 3389 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::IndentRequiresClause |
Indent the requires clause in a template.
This only applies when RequiresClausePosition is OwnLine, OwnLineWithBrace, or WithFollowing.
In clang-format 12, 13 and 14 it was named IndentRequires.
Definition at line 3412 of file Format.h.
Referenced by clang::format::getLLVMStyle(), operator==(), and clang::format::internal::reformat().
| unsigned clang::format::FormatStyle::IndentWidth |
The number of columns to use for indentation.
Definition at line 3426 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::IndentWrappedFunctionNames |
Indent if a function definition or declaration is wrapped after the type.
Definition at line 3440 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::InsertBraces |
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.
Definition at line 3472 of file Format.h.
Referenced by clang::format::getLLVMStyle(), operator==(), and clang::format::internal::reformat().
| bool clang::format::FormatStyle::InsertNewlineAtEOF |
Insert a newline at end of file if missing.
Definition at line 3476 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| TrailingCommaStyle clang::format::FormatStyle::InsertTrailingCommas |
If set to TCS_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 TCS_None. InsertTrailingCommas cannot be used together with BinPackArguments as inserting the comma disables bin-packing.
Definition at line 3506 of file Format.h.
Referenced by clang::format::getLLVMStyle().
| IntegerLiteralSeparatorStyle clang::format::FormatStyle::IntegerLiteralSeparator |
Format integer literal separators (‘’ for C/C++ and _` for C#, Java, and JavaScript).
Definition at line 3641 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::JavaImportGroups |
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. This will result in imports being formatted as in the Java example below.
Definition at line 3675 of file Format.h.
Referenced by clang::format::getChromiumStyle(), operator==(), and clang::format::sortJavaImports().
| JavaScriptQuoteStyle clang::format::FormatStyle::JavaScriptQuotes |
The JavaScriptQuoteStyle to use for JavaScript strings.
Definition at line 3702 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::JavaScriptWrapImports |
Whether to wrap JavaScript import/export statements.
Definition at line 3718 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| KeepEmptyLinesStyle clang::format::FormatStyle::KeepEmptyLines |
Which empty lines are kept.
See MaxEmptyLinesToKeep for how many consecutive empty lines are kept.
Definition at line 3755 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::KeepFormFeed |
This option is deprecated.
See AtEndOfFile of KeepEmptyLines.
Definition at line 3772 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| LambdaBodyIndentationKind clang::format::FormatStyle::LambdaBodyIndentation |
The indentation style of lambda bodies.
Signature (the default) causes the lambda body to be indented one additional level relative to the indentation level of the signature. OuterScope forces the lambda body to be indented one additional level relative to the parent scope containing the lambda signature.
Definition at line 3806 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| LanguageKind clang::format::FormatStyle::Language |
The language that this format style targets.
Definition at line 3861 of file Format.h.
Referenced by clang::format::FormatStyle::FormatStyleSet::Get(), clang::format::getGoogleStyle(), GetLanguageStyle(), clang::format::getLLVMStyle(), isCpp(), isCSharp(), isJava(), isJavaScript(), isJson(), isProto(), isTableGen(), isTextProto(), isVerilog(), operator==(), parseConfiguration, and clang::format::RawStringFormatStyleManager::RawStringFormatStyleManager().
| LineEndingStyle clang::format::FormatStyle::LineEnding |
Line ending style (\n or \r\n) to use.
Definition at line 3877 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::string clang::format::FormatStyle::MacroBlockBegin |
A regular expression matching macros that start a block.
Definition at line 3902 of file Format.h.
Referenced by operator==().
| std::string clang::format::FormatStyle::MacroBlockEnd |
A regular expression matching macros that end a block.
Definition at line 3906 of file Format.h.
Referenced by operator==().
| std::vector<std::string> clang::format::FormatStyle::Macros |
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:
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:
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:
Definition at line 3947 of file Format.h.
Referenced by operator==().
| std::vector<std::string> clang::format::FormatStyle::MacrosSkippedByRemoveParentheses |
A vector of function-like macros whose invocations should be skipped by RemoveParentheses.
Definition at line 3952 of file Format.h.
Referenced by operator==().
| unsigned clang::format::FormatStyle::MaxEmptyLinesToKeep |
The maximum number of consecutive empty lines to keep.
Definition at line 3966 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| NamespaceIndentationKind clang::format::FormatStyle::NamespaceIndentation |
The indentation used for namespaces.
Definition at line 4004 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::NamespaceMacros |
A vector of macros which are used to open namespace blocks.
These are expected to be macros of the form:
For example: TESTSUITE
Definition at line 4017 of file Format.h.
Referenced by operator==().
| NumericLiteralCaseStyle clang::format::FormatStyle::NumericLiteralCase |
Capitalization style for numeric literals.
Definition at line 4084 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| BinPackStyle clang::format::FormatStyle::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 BinPack, 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.
Definition at line 4117 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::ObjCBlockIndentWidth |
The number of characters to use for indentation of ObjC blocks.
Definition at line 4128 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::ObjCBreakBeforeNestedBlockParam |
Break parameters list into lines when there is nested block parameters in a function call.
Definition at line 4152 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::ObjCPropertyAttributeOrder |
The order in which ObjC property attributes should appear.
Attributes in code will be sorted in the order specified. Any attributes encountered that are not mentioned in this array will be sorted last, in stable order. Comments between attributes will leave the attributes untouched.
Definition at line 4175 of file Format.h.
Referenced by operator==().
| bool clang::format::FormatStyle::ObjCSpaceAfterMethodDeclarationPrefix |
Add or remove a space between the '-'/'+' and the return type in Objective-C method declarations.
i.e
Definition at line 4185 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::ObjCSpaceAfterProperty |
Add a space after @property in Objective-C, i.e.
use @property (readonly) instead of @property(readonly).
Definition at line 4190 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| bool clang::format::FormatStyle::ObjCSpaceBeforeProtocolList |
Add a space in front of an Objective-C protocol list, i.e.
use Foo <Protocol> instead of Foo<Protocol>.
Definition at line 4195 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| std::string clang::format::FormatStyle::OneLineFormatOffRegex |
A regular expression that describes markers for turning formatting off for one line.
If it matches a comment that is the only token of a line, clang-format skips the comment and the next line. Otherwise, clang-format skips lines containing a matched token.
Definition at line 4220 of file Format.h.
Referenced by operator==().
| PackArgumentsStyle clang::format::FormatStyle::PackArguments |
Options related to packing arguments of function calls.
Definition at line 4286 of file Format.h.
Referenced by clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| PackConstructorInitializersStyle clang::format::FormatStyle::PackConstructorInitializers |
The pack constructor initializers style to use.
Definition at line 4348 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| PackParametersStyle clang::format::FormatStyle::PackParameters |
Options related to packing parameters of function declarations and definitions.
Definition at line 4419 of file Format.h.
Referenced by clang::format::getChromiumStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakAssignment |
The penalty for breaking around an assignment operator.
Definition at line 4423 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakBeforeFirstCallParameter |
The penalty for breaking a function call after call(.
Definition at line 4427 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakBeforeMemberAccess |
The penalty for breaking before a member access operator (.
, ->).
Definition at line 4431 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakComment |
The penalty for each line break introduced inside a comment.
Definition at line 4435 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakFirstLessLess |
The penalty for breaking before the first <<.
Definition at line 4439 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakOpenParenthesis |
The penalty for breaking after (.
Definition at line 4443 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakScopeResolution |
The penalty for breaking after ::.
Definition at line 4447 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakString |
The penalty for each line break introduced inside a string literal.
Definition at line 4451 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyBreakTemplateDeclaration |
The penalty for breaking after template declaration.
Definition at line 4455 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyExcessCharacter |
The penalty for each character outside of the column limit.
Definition at line 4459 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::PenaltyIndentedWhitespace |
Penalty for each character of whitespace indentation (counted relative to leading non-whitespace column).
Definition at line 4464 of file Format.h.
Referenced by clang::format::getLLVMStyle().
| unsigned clang::format::FormatStyle::PenaltyReturnTypeOnItsOwnLine |
Penalty for putting the return type of a function onto its own line.
Definition at line 4468 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| PointerAlignmentStyle clang::format::FormatStyle::PointerAlignment |
Pointer and reference alignment style.
Definition at line 4491 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| int clang::format::FormatStyle::PPIndentWidth |
The number of columns to use for indentation of preprocessor statements.
When set to -1 (default) IndentWidth is used also for preprocessor statements.
Definition at line 4506 of file Format.h.
Referenced by clang::format::getLLVMStyle().
| QualifierAlignmentStyle clang::format::FormatStyle::QualifierAlignment |
Different ways to arrange specifiers and qualifiers (e.g.
const/volatile).
Definition at line 4552 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::QualifierOrder |
The order in which the qualifiers appear.
The order is an array that can contain any of the following:
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.
Definition at line 4578 of file Format.h.
Referenced by operator==().
| std::vector<RawStringFormat> clang::format::FormatStyle::RawStringFormats |
Defines hints for detecting supported languages code blocks in raw strings.
A raw string with a matching delimiter or a matching enclosing function name will be reformatted assuming the specified language based on the style for that language defined in the .clang-format file. If no style has been defined in the .clang-format file for the specific language, a predefined style given by BasedOnStyle is used. If BasedOnStyle is not found, the formatting is based on LLVM style. A matching delimiter takes precedence over a matching enclosing function name for determining the language of the raw string contents.
If a canonical delimiter is specified, occurrences of other delimiters for the same language will be updated to the canonical if possible.
There should be at most one specification per language and each delimiter and enclosing function should not occur in multiple specifications.
To configure this in the .clang-format file, use:
Definition at line 4638 of file Format.h.
Referenced by clang::format::getGoogleStyle(), operator==(), and clang::format::RawStringFormatStyleManager::RawStringFormatStyleManager().
| ReferenceAlignmentStyle clang::format::FormatStyle::ReferenceAlignment |
Reference alignment style (overrides PointerAlignment for references).
Definition at line 4663 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| ReflowCommentsStyle clang::format::FormatStyle::ReflowComments |
Comment reformatting style.
Definition at line 4701 of file Format.h.
Referenced by clang::format::getLLVMStyle().
| bool clang::format::FormatStyle::RemoveBracesLLVM |
Remove optional braces of control statements (if, else, for, and while) in C++ according to the LLVM coding style.
Definition at line 4755 of file Format.h.
Referenced by clang::format::getLLVMStyle(), operator==(), and clang::format::internal::reformat().
| bool clang::format::FormatStyle::RemoveEmptyLinesInUnwrappedLines |
Remove empty lines within unwrapped lines.
Definition at line 4778 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| RemoveParenthesesStyle clang::format::FormatStyle::RemoveParentheses |
Remove redundant parentheses.
Definition at line 4814 of file Format.h.
Referenced by clang::format::getLLVMStyle(), operator==(), and clang::format::internal::reformat().
| bool clang::format::FormatStyle::RemoveSemicolon |
Remove semicolons after the closing braces of functions and constructors/destructors.
Definition at line 4832 of file Format.h.
Referenced by clang::format::getLLVMStyle(), operator==(), and clang::format::internal::reformat().
| RequiresClausePositionStyle clang::format::FormatStyle::RequiresClausePosition |
The position of the requires clause.
Definition at line 4935 of file Format.h.
Referenced by clang::format::getLLVMStyle(), operator==(), and clang::format::internal::reformat().
| RequiresExpressionIndentationKind clang::format::FormatStyle::RequiresExpressionIndentation |
The indentation used for requires expression bodies.
Definition at line 4961 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| SeparateDefinitionStyle clang::format::FormatStyle::SeparateDefinitionBlocks |
Specifies the use of empty lines to separate definition blocks, including classes, structs, enums, and functions.
Definition at line 5019 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::ShortNamespaceLines |
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.
Definition at line 5041 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SkipMacroDefinitionBody |
Do not format macro definition body.
Definition at line 5045 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| SortIncludesOptions clang::format::FormatStyle::SortIncludes |
Controls if and how clang-format will sort #includes.
Definition at line 5093 of file Format.h.
Referenced by clang::format::formatReplacements(), clang::format::getLLVMStyle(), clang::format::getNoStyle(), and operator==().
| SortJavaStaticImportOptions clang::format::FormatStyle::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.
Definition at line 5117 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| SortUsingDeclarationsOptions clang::format::FormatStyle::SortUsingDeclarations |
Controls if and how clang-format will sort using declarations.
Definition at line 5161 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and clang::format::getNoStyle().
| bool clang::format::FormatStyle::SpaceAfterCStyleCast |
If true, a space is inserted after C style casts.
Definition at line 5169 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceAfterLogicalNot |
If true, a space is inserted after the logical not operator (!).
Definition at line 5177 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceAfterOperatorKeyword |
If true, a space will be inserted after the operator keyword.
Definition at line 5185 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceAfterTemplateKeyword |
If true, a space will be inserted after the template keyword.
Definition at line 5193 of file Format.h.
Referenced by clang::format::getLLVMStyle(), clang::format::getMozillaStyle(), and operator==().
| SpaceAroundPointerQualifiersStyle clang::format::FormatStyle::SpaceAroundPointerQualifiers |
Defines in which cases to put a space before or after pointer qualifiers.
Definition at line 5226 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceBeforeAssignmentOperators |
If false, spaces will be removed before assignment operators.
Definition at line 5235 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceBeforeCaseColon |
If false, spaces will be removed before case colon.
Definition at line 5245 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceBeforeCpp11BracedList |
If true, a space will be inserted before a C++11 braced list used to initialize an object (after the preceding identifier or type).
Definition at line 5257 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceBeforeCtorInitializerColon |
If false, spaces will be removed before constructor initializer colon.
Definition at line 5266 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceBeforeEnumUnderlyingTypeColon |
If false, spaces will be removed before enum underlying type colon.
Definition at line 5274 of file Format.h.
Referenced by clang::format::getLLVMStyle().
| bool clang::format::FormatStyle::SpaceBeforeInheritanceColon |
If false, spaces will be removed before inheritance colon.
Definition at line 5282 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceBeforeJsonColon |
If true, a space will be added before a JSON colon.
For other languages, e.g. JavaScript, use SpacesInContainerLiterals instead.
Definition at line 5293 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| SpaceBeforeParensStyle clang::format::FormatStyle::SpaceBeforeParens |
Defines in which cases to put a space before opening parentheses.
Definition at line 5354 of file Format.h.
Referenced by clang::format::expandPresetsSpaceBeforeParens(), clang::format::getLLVMStyle(), and operator==().
| SpaceBeforeParensCustom clang::format::FormatStyle::SpaceBeforeParensOptions |
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.
Definition at line 5488 of file Format.h.
Referenced by clang::format::expandPresetsSpaceBeforeParens(), clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceBeforeRangeBasedForLoopColon |
If false, spaces will be removed before range-based for loop colon.
Definition at line 5507 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpaceBeforeSquareBrackets |
If true, spaces will be before [.
Lambdas will not be affected. Only the first [ will get a space added.
Definition at line 5498 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| SpaceInEmptyBracesStyle clang::format::FormatStyle::SpaceInEmptyBraces |
Specifies when to insert a space in empty braces.
Definition at line 5547 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::SpacesBeforeTrailingComments |
If true, spaces may be inserted into ().
This option is deprecated. See InEmptyParentheses of SpacesInParensOptions.
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.
Definition at line 5573 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| SpacesInAnglesStyle clang::format::FormatStyle::SpacesInAngles |
The SpacesInAnglesStyle to use for template argument lists.
Definition at line 5596 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| bool clang::format::FormatStyle::SpacesInContainerLiterals |
If true, spaces will be inserted around if/for/switch/while conditions.
This option is deprecated. See InConditionalStatements of SpacesInParensOptions.
Definition at line 5638 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| SpacesInLineComment clang::format::FormatStyle::SpacesInLineCommentPrefix |
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.
Note that in line comment sections the relative indent of the subsequent lines is kept, that means the following:
This option has only effect if ReflowComments is set to true.
Definition at line 5686 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| SpacesInParensStyle clang::format::FormatStyle::SpacesInParens |
If true, spaces will be inserted after ( and before ).
This option is deprecated. The previous behavior is preserved by using SpacesInParens with Custom and by setting all SpacesInParensOptions to true except for InCStyleCasts and InEmptyParentheses.
Definition at line 5715 of file Format.h.
Referenced by clang::format::expandPresetsSpacesInParens(), clang::format::getLLVMStyle(), and operator==().
| SpacesInParensCustom clang::format::FormatStyle::SpacesInParensOptions |
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.
Definition at line 5808 of file Format.h.
Referenced by clang::format::expandPresetsSpacesInParens(), and operator==().
| bool clang::format::FormatStyle::SpacesInSquareBrackets |
If true, spaces will be inserted after [ and before ].
Lambdas without arguments or unspecified size array declarations will not be affected.
Definition at line 5819 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| LanguageStandard clang::format::FormatStyle::Standard |
Parse and format C++ constructs compatible with this standard.
Definition at line 5858 of file Format.h.
Referenced by clang::format::getGoogleStyle(), clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::StatementAttributeLikeMacros |
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.
Definition at line 5875 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::StatementMacros |
A vector of macros that should be interpreted as complete statements.
Typical macros are expressions and require a semicolon to be added. Sometimes this is not the case, and this allows to make clang-format aware of such cases.
For example: Q_UNUSED
Definition at line 5885 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::TableGenBreakingDAGArgOperators |
Works only when TableGenBreakInsideDAGArg is not DontBreak.
The string list needs to consist of identifiers in TableGen. If any identifier is specified, this limits the line breaks by TableGenBreakInsideDAGArg option only on DAGArg values beginning with the specified identifiers.
For example the configuration,
makes the line break only occurs inside DAGArgs beginning with the specified identifiers ins and outs.
Definition at line 5911 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| DAGArgStyle clang::format::FormatStyle::TableGenBreakInsideDAGArg |
The styles of the line break inside the DAGArg in TableGen.
Definition at line 5939 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| unsigned clang::format::FormatStyle::TabWidth |
The number of columns used for tab stops.
Definition at line 5943 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::TemplateNames |
A vector of non-keyword identifiers that should be interpreted as template names.
A < after a template name is annotated as a template opener instead of a binary operator.
Definition at line 5952 of file Format.h.
Referenced by operator==().
| std::vector<std::string> clang::format::FormatStyle::TypenameMacros |
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:
In the .clang-format configuration file, this can be configured like:
For example: OpenSSL STACK_OF, BSD LIST_ENTRY.
Definition at line 5979 of file Format.h.
Referenced by operator==().
| std::vector<std::string> clang::format::FormatStyle::TypeNames |
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.
Definition at line 5962 of file Format.h.
Referenced by operator==().
| UseTabStyle clang::format::FormatStyle::UseTab |
The way to use tab characters in the resulting file.
Definition at line 6004 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::VariableTemplates |
A vector of non-keyword identifiers that should be interpreted as variable template names.
A ) after a variable template instantiation is not annotated as the closing parenthesis of C-style cast operator.
Definition at line 6013 of file Format.h.
Referenced by operator==().
| bool clang::format::FormatStyle::VerilogBreakBetweenInstancePorts |
For Verilog, put each port on its own line in module instantiations.
Definition at line 6027 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
| std::vector<std::string> clang::format::FormatStyle::WhitespaceSensitiveMacros |
A vector of macros which are whitespace-sensitive and should not be touched.
These are expected to be macros of the form:
In the .clang-format configuration file, this can be configured like:
For example: BOOST_PP_STRINGIZE
Definition at line 6044 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().
The SpacesInBlockCommentsStyle to use for ordinary block comments.
Documentation comments such as `/** ...
...
| WrapNamespaceBodyWithEmptyLinesStyle clang::format::FormatStyle::WrapNamespaceBodyWithEmptyLines |
Wrap namespace body with empty lines.
Definition at line 6077 of file Format.h.
Referenced by clang::format::getLLVMStyle(), and operator==().