From 923f5c6b4e7cc8b6558b8580ca9ef999ebfef497 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 15 Aug 2022 09:59:16 -0700 Subject: [PATCH 1/4] Use unmodified official ClangFormat configuration as base formatter configuration The Arduino IDE's "Auto Format" feature is configured to produce the standard Arduino sketch formatting style by default. The Arduino IDE editor's default settings are compliant with that style. However, the user may adjust the editor settings. In this case, the Arduino IDE automatically adjusts the Auto Format configuration to align with the user's preferences. The formatter configuration is consumed by several other projects in addition to the Arduino IDE. For this reason, the configuration is hosted and maintained in a centralized location, from which it is pulled by all projects that use it. Previously, the adjustment of the Arduino IDE formatter configuration according to the editor settings was integrated into the configuration object itself. This meant that the standardized configuration had to be modified each time it was pulled in to sync from the upstream source. Moving the base formatter configuration object to a dedicated file, separated from the handling and adjustment code allows syncs to be done by simply replacing the existing configuration file with the one automatically generated by the CI system of the repository where the source configuration is hosted. --- .../src/node/clang-formatter.ts | 185 +--------------- .../src/node/default-formatter-config.json | 206 ++++++++++++++++++ arduino-ide-extension/tsconfig.json | 1 + 3 files changed, 210 insertions(+), 182 deletions(-) create mode 100644 arduino-ide-extension/src/node/default-formatter-config.json diff --git a/arduino-ide-extension/src/node/clang-formatter.ts b/arduino-ide-extension/src/node/clang-formatter.ts index 2431d96d6..c0873f76b 100644 --- a/arduino-ide-extension/src/node/clang-formatter.ts +++ b/arduino-ide-extension/src/node/clang-formatter.ts @@ -147,189 +147,10 @@ function styleJson({ UseTab, }: ClangFormatOptions): Record { // Source: https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration + const defaultConfig = require('./default-formatter-config.json'); // 1. require the JSON return { - AccessModifierOffset: -2, - AlignAfterOpenBracket: 'Align', - AlignArrayOfStructures: 'None', - AlignConsecutiveAssignments: 'None', - AlignConsecutiveBitFields: 'None', - AlignConsecutiveDeclarations: 'None', - AlignConsecutiveMacros: 'None', - AlignEscapedNewlines: 'DontAlign', - AlignOperands: 'Align', - AlignTrailingComments: true, - AllowAllArgumentsOnNextLine: true, - AllowAllConstructorInitializersOnNextLine: true, - AllowAllParametersOfDeclarationOnNextLine: true, - AllowShortBlocksOnASingleLine: 'Always', - AllowShortCaseLabelsOnASingleLine: true, - AllowShortEnumsOnASingleLine: true, - AllowShortFunctionsOnASingleLine: 'Empty', - AllowShortIfStatementsOnASingleLine: 'AllIfsAndElse', - AllowShortLambdasOnASingleLine: 'Empty', - AllowShortLoopsOnASingleLine: true, - AlwaysBreakAfterDefinitionReturnType: 'None', - AlwaysBreakAfterReturnType: 'None', - AlwaysBreakBeforeMultilineStrings: false, - AlwaysBreakTemplateDeclarations: 'No', - AttributeMacros: ['__capability'], - BasedOnStyle: 'LLVM', - BinPackArguments: true, - BinPackParameters: true, - BitFieldColonSpacing: 'Both', - BraceWrapping: { - AfterCaseLabel: false, - AfterClass: false, - AfterControlStatement: 'Never', - AfterEnum: false, - AfterFunction: false, - AfterNamespace: false, - AfterObjCDeclaration: false, - AfterStruct: false, - AfterUnion: false, - AfterExternBlock: false, - BeforeCatch: false, - BeforeElse: false, - BeforeLambdaBody: false, - BeforeWhile: false, - IndentBraces: false, - SplitEmptyFunction: true, - SplitEmptyRecord: true, - SplitEmptyNamespace: true, - }, - BreakAfterJavaFieldAnnotations: false, - BreakBeforeBinaryOperators: 'NonAssignment', - BreakBeforeBraces: 'Attach', - BreakBeforeConceptDeclarations: false, - BreakBeforeInheritanceComma: false, - BreakBeforeTernaryOperators: true, - BreakConstructorInitializers: 'BeforeColon', - BreakConstructorInitializersBeforeComma: false, - BreakInheritanceList: 'BeforeColon', - BreakStringLiterals: false, - ColumnLimit: 0, - CommentPragmas: '', - CompactNamespaces: false, - ConstructorInitializerAllOnOneLineOrOnePerLine: false, - ConstructorInitializerIndentWidth: 2, - ContinuationIndentWidth: 2, - Cpp11BracedListStyle: false, - DeriveLineEnding: true, - DerivePointerAlignment: true, - DisableFormat: false, - EmptyLineAfterAccessModifier: 'Leave', - EmptyLineBeforeAccessModifier: 'Leave', - ExperimentalAutoDetectBinPacking: false, - FixNamespaceComments: false, - ForEachMacros: ['foreach', 'Q_FOREACH', 'BOOST_FOREACH'], - IfMacros: ['KJ_IF_MAYBE'], - IncludeBlocks: 'Preserve', - IncludeCategories: [ - { - Regex: '^"(llvm|llvm-c|clang|clang-c)/', - Priority: 2, - SortPriority: 0, - CaseSensitive: false, - }, - { - Regex: '^(<|"(gtest|gmock|isl|json)/)', - Priority: 3, - SortPriority: 0, - CaseSensitive: false, - }, - { Regex: '.*', Priority: 1, SortPriority: 0, CaseSensitive: false }, - ], - IncludeIsMainRegex: '', - IncludeIsMainSourceRegex: '', - IndentAccessModifiers: false, - IndentCaseBlocks: true, - IndentCaseLabels: true, - IndentExternBlock: 'Indent', - IndentGotoLabels: false, - IndentPPDirectives: 'None', - IndentRequires: true, - IndentWidth: 2, - IndentWrappedFunctionNames: false, - InsertTrailingCommas: 'None', - JavaScriptQuotes: 'Leave', - JavaScriptWrapImports: true, - KeepEmptyLinesAtTheStartOfBlocks: true, - LambdaBodyIndentation: 'Signature', - Language: 'Cpp', - MacroBlockBegin: '', - MacroBlockEnd: '', - MaxEmptyLinesToKeep: 100000, - NamespaceIndentation: 'None', - ObjCBinPackProtocolList: 'Auto', - ObjCBlockIndentWidth: 2, - ObjCBreakBeforeNestedBlockParam: true, - ObjCSpaceAfterProperty: false, - ObjCSpaceBeforeProtocolList: true, - PPIndentWidth: -1, - PackConstructorInitializers: 'BinPack', - PenaltyBreakAssignment: 1, - PenaltyBreakBeforeFirstCallParameter: 1, - PenaltyBreakComment: 1, - PenaltyBreakFirstLessLess: 1, - PenaltyBreakOpenParenthesis: 1, - PenaltyBreakString: 1, - PenaltyBreakTemplateDeclaration: 1, - PenaltyExcessCharacter: 1, - PenaltyIndentedWhitespace: 1, - PenaltyReturnTypeOnItsOwnLine: 1, - PointerAlignment: 'Right', - QualifierAlignment: 'Leave', - ReferenceAlignment: 'Pointer', - ReflowComments: false, - RemoveBracesLLVM: false, - SeparateDefinitionBlocks: 'Leave', - ShortNamespaceLines: 0, - SortIncludes: 'Never', - SortJavaStaticImport: 'Before', - SortUsingDeclarations: false, - SpaceAfterCStyleCast: false, - SpaceAfterLogicalNot: false, - SpaceAfterTemplateKeyword: false, - SpaceAroundPointerQualifiers: 'Default', - SpaceBeforeAssignmentOperators: true, - SpaceBeforeCaseColon: false, - SpaceBeforeCpp11BracedList: false, - SpaceBeforeCtorInitializerColon: true, - SpaceBeforeInheritanceColon: true, - SpaceBeforeParens: 'ControlStatements', - SpaceBeforeParensOptions: { - AfterControlStatements: true, - AfterForeachMacros: true, - AfterFunctionDefinitionName: false, - AfterFunctionDeclarationName: false, - AfterIfMacros: true, - AfterOverloadedOperator: false, - BeforeNonEmptyParentheses: false, - }, - SpaceBeforeRangeBasedForLoopColon: true, - SpaceBeforeSquareBrackets: false, - SpaceInEmptyBlock: false, - SpaceInEmptyParentheses: false, - SpacesBeforeTrailingComments: 2, - SpacesInAngles: 'Leave', - SpacesInCStyleCastParentheses: false, - SpacesInConditionalStatement: false, - SpacesInContainerLiterals: false, - SpacesInLineCommentPrefix: { Minimum: 0, Maximum: -1 }, - SpacesInParentheses: false, - SpacesInSquareBrackets: false, - Standard: 'Auto', - StatementAttributeLikeMacros: ['Q_EMIT'], - StatementMacros: ['Q_UNUSED', 'QT_REQUIRE_VERSION'], - TabWidth, - UseCRLF: false, + ...defaultConfig, + TabWidth, // 2. override the default values with the user-defined ones UseTab, - WhitespaceSensitiveMacros: [ - 'STRINGIZE', - 'PP_STRINGIZE', - 'BOOST_PP_STRINGIZE', - 'NS_SWIFT_NAME', - 'CF_SWIFT_NAME', - ], }; } diff --git a/arduino-ide-extension/src/node/default-formatter-config.json b/arduino-ide-extension/src/node/default-formatter-config.json new file mode 100644 index 000000000..9326847d6 --- /dev/null +++ b/arduino-ide-extension/src/node/default-formatter-config.json @@ -0,0 +1,206 @@ +{ + "AccessModifierOffset": -2, + "AlignAfterOpenBracket": "Align", + "AlignArrayOfStructures": "None", + "AlignConsecutiveAssignments": "None", + "AlignConsecutiveBitFields": "None", + "AlignConsecutiveDeclarations": "None", + "AlignConsecutiveMacros": "None", + "AlignEscapedNewlines": "DontAlign", + "AlignOperands": "Align", + "AlignTrailingComments": true, + "AllowAllArgumentsOnNextLine": true, + "AllowAllConstructorInitializersOnNextLine": true, + "AllowAllParametersOfDeclarationOnNextLine": true, + "AllowShortBlocksOnASingleLine": "Always", + "AllowShortCaseLabelsOnASingleLine": true, + "AllowShortEnumsOnASingleLine": true, + "AllowShortFunctionsOnASingleLine": "Empty", + "AllowShortIfStatementsOnASingleLine": "AllIfsAndElse", + "AllowShortLambdasOnASingleLine": "Empty", + "AllowShortLoopsOnASingleLine": true, + "AlwaysBreakAfterDefinitionReturnType": "None", + "AlwaysBreakAfterReturnType": "None", + "AlwaysBreakBeforeMultilineStrings": false, + "AlwaysBreakTemplateDeclarations": "No", + "AttributeMacros": [ + "__capability" + ], + "BasedOnStyle": "LLVM", + "BinPackArguments": true, + "BinPackParameters": true, + "BitFieldColonSpacing": "Both", + "BraceWrapping": { + "AfterCaseLabel": false, + "AfterClass": false, + "AfterControlStatement": "Never", + "AfterEnum": false, + "AfterFunction": false, + "AfterNamespace": false, + "AfterObjCDeclaration": false, + "AfterStruct": false, + "AfterUnion": false, + "AfterExternBlock": false, + "BeforeCatch": false, + "BeforeElse": false, + "BeforeLambdaBody": false, + "BeforeWhile": false, + "IndentBraces": false, + "SplitEmptyFunction": true, + "SplitEmptyRecord": true, + "SplitEmptyNamespace": true + }, + "BreakAfterJavaFieldAnnotations": false, + "BreakBeforeBinaryOperators": "NonAssignment", + "BreakBeforeBraces": "Attach", + "BreakBeforeConceptDeclarations": false, + "BreakBeforeInheritanceComma": false, + "BreakBeforeTernaryOperators": true, + "BreakConstructorInitializers": "BeforeColon", + "BreakConstructorInitializersBeforeComma": false, + "BreakInheritanceList": "BeforeColon", + "BreakStringLiterals": false, + "ColumnLimit": 0, + "CommentPragmas": "", + "CompactNamespaces": false, + "ConstructorInitializerAllOnOneLineOrOnePerLine": false, + "ConstructorInitializerIndentWidth": 2, + "ContinuationIndentWidth": 2, + "Cpp11BracedListStyle": false, + "DeriveLineEnding": true, + "DerivePointerAlignment": true, + "DisableFormat": false, + "EmptyLineAfterAccessModifier": "Leave", + "EmptyLineBeforeAccessModifier": "Leave", + "ExperimentalAutoDetectBinPacking": false, + "FixNamespaceComments": false, + "ForEachMacros": [ + "foreach", + "Q_FOREACH", + "BOOST_FOREACH" + ], + "IfMacros": [ + "KJ_IF_MAYBE" + ], + "IncludeBlocks": "Preserve", + "IncludeCategories": [ + { + "Regex": "^\"(llvm|llvm-c|clang|clang-c)/", + "Priority": 2, + "SortPriority": 0, + "CaseSensitive": false + }, + { + "Regex": "^(<|\"(gtest|gmock|isl|json)/)", + "Priority": 3, + "SortPriority": 0, + "CaseSensitive": false + }, + { + "Regex": ".*", + "Priority": 1, + "SortPriority": 0, + "CaseSensitive": false + } + ], + "IncludeIsMainRegex": "", + "IncludeIsMainSourceRegex": "", + "IndentAccessModifiers": false, + "IndentCaseBlocks": true, + "IndentCaseLabels": true, + "IndentExternBlock": "Indent", + "IndentGotoLabels": false, + "IndentPPDirectives": "None", + "IndentRequires": true, + "IndentWidth": 2, + "IndentWrappedFunctionNames": false, + "InsertTrailingCommas": "None", + "JavaScriptQuotes": "Leave", + "JavaScriptWrapImports": true, + "KeepEmptyLinesAtTheStartOfBlocks": true, + "LambdaBodyIndentation": "Signature", + "Language": "Cpp", + "MacroBlockBegin": "", + "MacroBlockEnd": "", + "MaxEmptyLinesToKeep": 100000, + "NamespaceIndentation": "None", + "ObjCBinPackProtocolList": "Auto", + "ObjCBlockIndentWidth": 2, + "ObjCBreakBeforeNestedBlockParam": true, + "ObjCSpaceAfterProperty": false, + "ObjCSpaceBeforeProtocolList": true, + "PPIndentWidth": -1, + "PackConstructorInitializers": "BinPack", + "PenaltyBreakAssignment": 1, + "PenaltyBreakBeforeFirstCallParameter": 1, + "PenaltyBreakComment": 1, + "PenaltyBreakFirstLessLess": 1, + "PenaltyBreakOpenParenthesis": 1, + "PenaltyBreakString": 1, + "PenaltyBreakTemplateDeclaration": 1, + "PenaltyExcessCharacter": 1, + "PenaltyIndentedWhitespace": 1, + "PenaltyReturnTypeOnItsOwnLine": 1, + "PointerAlignment": "Right", + "QualifierAlignment": "Leave", + "ReferenceAlignment": "Pointer", + "ReflowComments": false, + "RemoveBracesLLVM": false, + "SeparateDefinitionBlocks": "Leave", + "ShortNamespaceLines": 0, + "SortIncludes": "Never", + "SortJavaStaticImport": "Before", + "SortUsingDeclarations": false, + "SpaceAfterCStyleCast": false, + "SpaceAfterLogicalNot": false, + "SpaceAfterTemplateKeyword": false, + "SpaceAroundPointerQualifiers": "Default", + "SpaceBeforeAssignmentOperators": true, + "SpaceBeforeCaseColon": false, + "SpaceBeforeCpp11BracedList": false, + "SpaceBeforeCtorInitializerColon": true, + "SpaceBeforeInheritanceColon": true, + "SpaceBeforeParens": "ControlStatements", + "SpaceBeforeParensOptions": { + "AfterControlStatements": true, + "AfterForeachMacros": true, + "AfterFunctionDefinitionName": false, + "AfterFunctionDeclarationName": false, + "AfterIfMacros": true, + "AfterOverloadedOperator": false, + "BeforeNonEmptyParentheses": false + }, + "SpaceBeforeRangeBasedForLoopColon": true, + "SpaceBeforeSquareBrackets": false, + "SpaceInEmptyBlock": false, + "SpaceInEmptyParentheses": false, + "SpacesBeforeTrailingComments": 2, + "SpacesInAngles": "Leave", + "SpacesInCStyleCastParentheses": false, + "SpacesInConditionalStatement": false, + "SpacesInContainerLiterals": false, + "SpacesInLineCommentPrefix": { + "Minimum": 0, + "Maximum": -1 + }, + "SpacesInParentheses": false, + "SpacesInSquareBrackets": false, + "Standard": "Auto", + "StatementAttributeLikeMacros": [ + "Q_EMIT" + ], + "StatementMacros": [ + "Q_UNUSED", + "QT_REQUIRE_VERSION" + ], + "TabWidth": 2, + "UseCRLF": false, + "UseTab": "Never", + "WhitespaceSensitiveMacros": [ + "STRINGIZE", + "PP_STRINGIZE", + "BOOST_PP_STRINGIZE", + "NS_SWIFT_NAME", + "CF_SWIFT_NAME" + ] +} diff --git a/arduino-ide-extension/tsconfig.json b/arduino-ide-extension/tsconfig.json index 24604fe4c..31b89c625 100644 --- a/arduino-ide-extension/tsconfig.json +++ b/arduino-ide-extension/tsconfig.json @@ -13,6 +13,7 @@ "emitDecoratorMetadata": true, "module": "commonjs", "moduleResolution": "node", + "resolveJsonModule": true, "target": "ES2017", "outDir": "lib", "lib": [ From becb9013da4f915aec3e138bb10a14903698b901 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 16 Aug 2022 05:35:29 -0700 Subject: [PATCH 2/4] Correct relative path to formatter configuration file --- arduino-ide-extension/src/node/clang-formatter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino-ide-extension/src/node/clang-formatter.ts b/arduino-ide-extension/src/node/clang-formatter.ts index c0873f76b..5c4cfe572 100644 --- a/arduino-ide-extension/src/node/clang-formatter.ts +++ b/arduino-ide-extension/src/node/clang-formatter.ts @@ -147,7 +147,7 @@ function styleJson({ UseTab, }: ClangFormatOptions): Record { // Source: https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration - const defaultConfig = require('./default-formatter-config.json'); // 1. require the JSON + const defaultConfig = require('../../src/node/default-formatter-config.json'); // 1. require the JSON return { ...defaultConfig, TabWidth, // 2. override the default values with the user-defined ones From aff356078cfa066215b445cc925d918876a6d5e2 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 16 Aug 2022 05:36:05 -0700 Subject: [PATCH 3/4] Remove unnecessary comments from formatter code --- arduino-ide-extension/src/node/clang-formatter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arduino-ide-extension/src/node/clang-formatter.ts b/arduino-ide-extension/src/node/clang-formatter.ts index 5c4cfe572..a1ba2345e 100644 --- a/arduino-ide-extension/src/node/clang-formatter.ts +++ b/arduino-ide-extension/src/node/clang-formatter.ts @@ -147,10 +147,10 @@ function styleJson({ UseTab, }: ClangFormatOptions): Record { // Source: https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration - const defaultConfig = require('../../src/node/default-formatter-config.json'); // 1. require the JSON + const defaultConfig = require('../../src/node/default-formatter-config.json'); return { ...defaultConfig, - TabWidth, // 2. override the default values with the user-defined ones + TabWidth, UseTab, }; } From fe5171161ce377cebe618385e664cdd89b04386d Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 16 Aug 2022 05:37:15 -0700 Subject: [PATCH 4/4] Format formatter configuration with prettier --- .../src/node/default-formatter-config.json | 391 +++++++++--------- 1 file changed, 189 insertions(+), 202 deletions(-) diff --git a/arduino-ide-extension/src/node/default-formatter-config.json b/arduino-ide-extension/src/node/default-formatter-config.json index 9326847d6..f0f560449 100644 --- a/arduino-ide-extension/src/node/default-formatter-config.json +++ b/arduino-ide-extension/src/node/default-formatter-config.json @@ -1,206 +1,193 @@ { - "AccessModifierOffset": -2, - "AlignAfterOpenBracket": "Align", - "AlignArrayOfStructures": "None", - "AlignConsecutiveAssignments": "None", - "AlignConsecutiveBitFields": "None", - "AlignConsecutiveDeclarations": "None", - "AlignConsecutiveMacros": "None", - "AlignEscapedNewlines": "DontAlign", - "AlignOperands": "Align", - "AlignTrailingComments": true, - "AllowAllArgumentsOnNextLine": true, - "AllowAllConstructorInitializersOnNextLine": true, - "AllowAllParametersOfDeclarationOnNextLine": true, - "AllowShortBlocksOnASingleLine": "Always", - "AllowShortCaseLabelsOnASingleLine": true, - "AllowShortEnumsOnASingleLine": true, - "AllowShortFunctionsOnASingleLine": "Empty", - "AllowShortIfStatementsOnASingleLine": "AllIfsAndElse", - "AllowShortLambdasOnASingleLine": "Empty", - "AllowShortLoopsOnASingleLine": true, - "AlwaysBreakAfterDefinitionReturnType": "None", - "AlwaysBreakAfterReturnType": "None", - "AlwaysBreakBeforeMultilineStrings": false, - "AlwaysBreakTemplateDeclarations": "No", - "AttributeMacros": [ - "__capability" - ], - "BasedOnStyle": "LLVM", - "BinPackArguments": true, - "BinPackParameters": true, - "BitFieldColonSpacing": "Both", - "BraceWrapping": { - "AfterCaseLabel": false, - "AfterClass": false, - "AfterControlStatement": "Never", - "AfterEnum": false, - "AfterFunction": false, - "AfterNamespace": false, - "AfterObjCDeclaration": false, - "AfterStruct": false, - "AfterUnion": false, - "AfterExternBlock": false, - "BeforeCatch": false, - "BeforeElse": false, - "BeforeLambdaBody": false, - "BeforeWhile": false, - "IndentBraces": false, - "SplitEmptyFunction": true, - "SplitEmptyRecord": true, - "SplitEmptyNamespace": true + "AccessModifierOffset": -2, + "AlignAfterOpenBracket": "Align", + "AlignArrayOfStructures": "None", + "AlignConsecutiveAssignments": "None", + "AlignConsecutiveBitFields": "None", + "AlignConsecutiveDeclarations": "None", + "AlignConsecutiveMacros": "None", + "AlignEscapedNewlines": "DontAlign", + "AlignOperands": "Align", + "AlignTrailingComments": true, + "AllowAllArgumentsOnNextLine": true, + "AllowAllConstructorInitializersOnNextLine": true, + "AllowAllParametersOfDeclarationOnNextLine": true, + "AllowShortBlocksOnASingleLine": "Always", + "AllowShortCaseLabelsOnASingleLine": true, + "AllowShortEnumsOnASingleLine": true, + "AllowShortFunctionsOnASingleLine": "Empty", + "AllowShortIfStatementsOnASingleLine": "AllIfsAndElse", + "AllowShortLambdasOnASingleLine": "Empty", + "AllowShortLoopsOnASingleLine": true, + "AlwaysBreakAfterDefinitionReturnType": "None", + "AlwaysBreakAfterReturnType": "None", + "AlwaysBreakBeforeMultilineStrings": false, + "AlwaysBreakTemplateDeclarations": "No", + "AttributeMacros": ["__capability"], + "BasedOnStyle": "LLVM", + "BinPackArguments": true, + "BinPackParameters": true, + "BitFieldColonSpacing": "Both", + "BraceWrapping": { + "AfterCaseLabel": false, + "AfterClass": false, + "AfterControlStatement": "Never", + "AfterEnum": false, + "AfterFunction": false, + "AfterNamespace": false, + "AfterObjCDeclaration": false, + "AfterStruct": false, + "AfterUnion": false, + "AfterExternBlock": false, + "BeforeCatch": false, + "BeforeElse": false, + "BeforeLambdaBody": false, + "BeforeWhile": false, + "IndentBraces": false, + "SplitEmptyFunction": true, + "SplitEmptyRecord": true, + "SplitEmptyNamespace": true + }, + "BreakAfterJavaFieldAnnotations": false, + "BreakBeforeBinaryOperators": "NonAssignment", + "BreakBeforeBraces": "Attach", + "BreakBeforeConceptDeclarations": false, + "BreakBeforeInheritanceComma": false, + "BreakBeforeTernaryOperators": true, + "BreakConstructorInitializers": "BeforeColon", + "BreakConstructorInitializersBeforeComma": false, + "BreakInheritanceList": "BeforeColon", + "BreakStringLiterals": false, + "ColumnLimit": 0, + "CommentPragmas": "", + "CompactNamespaces": false, + "ConstructorInitializerAllOnOneLineOrOnePerLine": false, + "ConstructorInitializerIndentWidth": 2, + "ContinuationIndentWidth": 2, + "Cpp11BracedListStyle": false, + "DeriveLineEnding": true, + "DerivePointerAlignment": true, + "DisableFormat": false, + "EmptyLineAfterAccessModifier": "Leave", + "EmptyLineBeforeAccessModifier": "Leave", + "ExperimentalAutoDetectBinPacking": false, + "FixNamespaceComments": false, + "ForEachMacros": ["foreach", "Q_FOREACH", "BOOST_FOREACH"], + "IfMacros": ["KJ_IF_MAYBE"], + "IncludeBlocks": "Preserve", + "IncludeCategories": [ + { + "Regex": "^\"(llvm|llvm-c|clang|clang-c)/", + "Priority": 2, + "SortPriority": 0, + "CaseSensitive": false }, - "BreakAfterJavaFieldAnnotations": false, - "BreakBeforeBinaryOperators": "NonAssignment", - "BreakBeforeBraces": "Attach", - "BreakBeforeConceptDeclarations": false, - "BreakBeforeInheritanceComma": false, - "BreakBeforeTernaryOperators": true, - "BreakConstructorInitializers": "BeforeColon", - "BreakConstructorInitializersBeforeComma": false, - "BreakInheritanceList": "BeforeColon", - "BreakStringLiterals": false, - "ColumnLimit": 0, - "CommentPragmas": "", - "CompactNamespaces": false, - "ConstructorInitializerAllOnOneLineOrOnePerLine": false, - "ConstructorInitializerIndentWidth": 2, - "ContinuationIndentWidth": 2, - "Cpp11BracedListStyle": false, - "DeriveLineEnding": true, - "DerivePointerAlignment": true, - "DisableFormat": false, - "EmptyLineAfterAccessModifier": "Leave", - "EmptyLineBeforeAccessModifier": "Leave", - "ExperimentalAutoDetectBinPacking": false, - "FixNamespaceComments": false, - "ForEachMacros": [ - "foreach", - "Q_FOREACH", - "BOOST_FOREACH" - ], - "IfMacros": [ - "KJ_IF_MAYBE" - ], - "IncludeBlocks": "Preserve", - "IncludeCategories": [ - { - "Regex": "^\"(llvm|llvm-c|clang|clang-c)/", - "Priority": 2, - "SortPriority": 0, - "CaseSensitive": false - }, - { - "Regex": "^(<|\"(gtest|gmock|isl|json)/)", - "Priority": 3, - "SortPriority": 0, - "CaseSensitive": false - }, - { - "Regex": ".*", - "Priority": 1, - "SortPriority": 0, - "CaseSensitive": false - } - ], - "IncludeIsMainRegex": "", - "IncludeIsMainSourceRegex": "", - "IndentAccessModifiers": false, - "IndentCaseBlocks": true, - "IndentCaseLabels": true, - "IndentExternBlock": "Indent", - "IndentGotoLabels": false, - "IndentPPDirectives": "None", - "IndentRequires": true, - "IndentWidth": 2, - "IndentWrappedFunctionNames": false, - "InsertTrailingCommas": "None", - "JavaScriptQuotes": "Leave", - "JavaScriptWrapImports": true, - "KeepEmptyLinesAtTheStartOfBlocks": true, - "LambdaBodyIndentation": "Signature", - "Language": "Cpp", - "MacroBlockBegin": "", - "MacroBlockEnd": "", - "MaxEmptyLinesToKeep": 100000, - "NamespaceIndentation": "None", - "ObjCBinPackProtocolList": "Auto", - "ObjCBlockIndentWidth": 2, - "ObjCBreakBeforeNestedBlockParam": true, - "ObjCSpaceAfterProperty": false, - "ObjCSpaceBeforeProtocolList": true, - "PPIndentWidth": -1, - "PackConstructorInitializers": "BinPack", - "PenaltyBreakAssignment": 1, - "PenaltyBreakBeforeFirstCallParameter": 1, - "PenaltyBreakComment": 1, - "PenaltyBreakFirstLessLess": 1, - "PenaltyBreakOpenParenthesis": 1, - "PenaltyBreakString": 1, - "PenaltyBreakTemplateDeclaration": 1, - "PenaltyExcessCharacter": 1, - "PenaltyIndentedWhitespace": 1, - "PenaltyReturnTypeOnItsOwnLine": 1, - "PointerAlignment": "Right", - "QualifierAlignment": "Leave", - "ReferenceAlignment": "Pointer", - "ReflowComments": false, - "RemoveBracesLLVM": false, - "SeparateDefinitionBlocks": "Leave", - "ShortNamespaceLines": 0, - "SortIncludes": "Never", - "SortJavaStaticImport": "Before", - "SortUsingDeclarations": false, - "SpaceAfterCStyleCast": false, - "SpaceAfterLogicalNot": false, - "SpaceAfterTemplateKeyword": false, - "SpaceAroundPointerQualifiers": "Default", - "SpaceBeforeAssignmentOperators": true, - "SpaceBeforeCaseColon": false, - "SpaceBeforeCpp11BracedList": false, - "SpaceBeforeCtorInitializerColon": true, - "SpaceBeforeInheritanceColon": true, - "SpaceBeforeParens": "ControlStatements", - "SpaceBeforeParensOptions": { - "AfterControlStatements": true, - "AfterForeachMacros": true, - "AfterFunctionDefinitionName": false, - "AfterFunctionDeclarationName": false, - "AfterIfMacros": true, - "AfterOverloadedOperator": false, - "BeforeNonEmptyParentheses": false + { + "Regex": "^(<|\"(gtest|gmock|isl|json)/)", + "Priority": 3, + "SortPriority": 0, + "CaseSensitive": false }, - "SpaceBeforeRangeBasedForLoopColon": true, - "SpaceBeforeSquareBrackets": false, - "SpaceInEmptyBlock": false, - "SpaceInEmptyParentheses": false, - "SpacesBeforeTrailingComments": 2, - "SpacesInAngles": "Leave", - "SpacesInCStyleCastParentheses": false, - "SpacesInConditionalStatement": false, - "SpacesInContainerLiterals": false, - "SpacesInLineCommentPrefix": { - "Minimum": 0, - "Maximum": -1 - }, - "SpacesInParentheses": false, - "SpacesInSquareBrackets": false, - "Standard": "Auto", - "StatementAttributeLikeMacros": [ - "Q_EMIT" - ], - "StatementMacros": [ - "Q_UNUSED", - "QT_REQUIRE_VERSION" - ], - "TabWidth": 2, - "UseCRLF": false, - "UseTab": "Never", - "WhitespaceSensitiveMacros": [ - "STRINGIZE", - "PP_STRINGIZE", - "BOOST_PP_STRINGIZE", - "NS_SWIFT_NAME", - "CF_SWIFT_NAME" - ] + { + "Regex": ".*", + "Priority": 1, + "SortPriority": 0, + "CaseSensitive": false + } + ], + "IncludeIsMainRegex": "", + "IncludeIsMainSourceRegex": "", + "IndentAccessModifiers": false, + "IndentCaseBlocks": true, + "IndentCaseLabels": true, + "IndentExternBlock": "Indent", + "IndentGotoLabels": false, + "IndentPPDirectives": "None", + "IndentRequires": true, + "IndentWidth": 2, + "IndentWrappedFunctionNames": false, + "InsertTrailingCommas": "None", + "JavaScriptQuotes": "Leave", + "JavaScriptWrapImports": true, + "KeepEmptyLinesAtTheStartOfBlocks": true, + "LambdaBodyIndentation": "Signature", + "Language": "Cpp", + "MacroBlockBegin": "", + "MacroBlockEnd": "", + "MaxEmptyLinesToKeep": 100000, + "NamespaceIndentation": "None", + "ObjCBinPackProtocolList": "Auto", + "ObjCBlockIndentWidth": 2, + "ObjCBreakBeforeNestedBlockParam": true, + "ObjCSpaceAfterProperty": false, + "ObjCSpaceBeforeProtocolList": true, + "PPIndentWidth": -1, + "PackConstructorInitializers": "BinPack", + "PenaltyBreakAssignment": 1, + "PenaltyBreakBeforeFirstCallParameter": 1, + "PenaltyBreakComment": 1, + "PenaltyBreakFirstLessLess": 1, + "PenaltyBreakOpenParenthesis": 1, + "PenaltyBreakString": 1, + "PenaltyBreakTemplateDeclaration": 1, + "PenaltyExcessCharacter": 1, + "PenaltyIndentedWhitespace": 1, + "PenaltyReturnTypeOnItsOwnLine": 1, + "PointerAlignment": "Right", + "QualifierAlignment": "Leave", + "ReferenceAlignment": "Pointer", + "ReflowComments": false, + "RemoveBracesLLVM": false, + "SeparateDefinitionBlocks": "Leave", + "ShortNamespaceLines": 0, + "SortIncludes": "Never", + "SortJavaStaticImport": "Before", + "SortUsingDeclarations": false, + "SpaceAfterCStyleCast": false, + "SpaceAfterLogicalNot": false, + "SpaceAfterTemplateKeyword": false, + "SpaceAroundPointerQualifiers": "Default", + "SpaceBeforeAssignmentOperators": true, + "SpaceBeforeCaseColon": false, + "SpaceBeforeCpp11BracedList": false, + "SpaceBeforeCtorInitializerColon": true, + "SpaceBeforeInheritanceColon": true, + "SpaceBeforeParens": "ControlStatements", + "SpaceBeforeParensOptions": { + "AfterControlStatements": true, + "AfterForeachMacros": true, + "AfterFunctionDefinitionName": false, + "AfterFunctionDeclarationName": false, + "AfterIfMacros": true, + "AfterOverloadedOperator": false, + "BeforeNonEmptyParentheses": false + }, + "SpaceBeforeRangeBasedForLoopColon": true, + "SpaceBeforeSquareBrackets": false, + "SpaceInEmptyBlock": false, + "SpaceInEmptyParentheses": false, + "SpacesBeforeTrailingComments": 2, + "SpacesInAngles": "Leave", + "SpacesInCStyleCastParentheses": false, + "SpacesInConditionalStatement": false, + "SpacesInContainerLiterals": false, + "SpacesInLineCommentPrefix": { + "Minimum": 0, + "Maximum": -1 + }, + "SpacesInParentheses": false, + "SpacesInSquareBrackets": false, + "Standard": "Auto", + "StatementAttributeLikeMacros": ["Q_EMIT"], + "StatementMacros": ["Q_UNUSED", "QT_REQUIRE_VERSION"], + "TabWidth": 2, + "UseCRLF": false, + "UseTab": "Never", + "WhitespaceSensitiveMacros": [ + "STRINGIZE", + "PP_STRINGIZE", + "BOOST_PP_STRINGIZE", + "NS_SWIFT_NAME", + "CF_SWIFT_NAME" + ] }