I created a .clang-format file to set up my code like I like it. I referenced the Clang Format documentation at https://clang.llvm.org/docs/ClangFormatStyleOptions.html. I understand that VS uses clang version 5, and a few formatting directives may
get flagged, but when I run the Tools -> "Clang Format Document" it raised error flags on almost every directive. What am I doing wrong?
My .clang-format file is as follows:
AccessModififerOffset: 2
AlignAfterOpenBracket: BAS_Align
AlignConsecutiveStatements: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: left
AlignOperannd: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: SFS_None
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: BTS_All
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: BTDS_Yes
BinPackArguments: false
BinPackParameters:
false
BreakBeforeBraces: Custom
BraceWrappimg:
AfterClass: true
AfterControlStatement: true
bool AfterEnum: false
bool AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: BOS_NonAssignment
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BCIS_AfterColon
BreakInheritanceList: BILS_AfterColon
BreakStringLiterals: true
ColumnLimit: 90
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
FixNamespaceComments: true
IncludeBlocks: IBS_Regroup
IndentCaseLabel: true
IndentPPDirectives: PPDIS_AfterHash
IndentWidth: 2
IndentWrappedFunctionNames:true
KeepEmptyLinesAtTheStartOfBlocks: false
Language: LK_Cpp
MaxEmptyLinesToKeep: 2
NamespaceIndentation: NI_All
PointerAlignment: PAS_Left
ReflowComments: true
ReflowComments: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: FALSE
SpaceBeforeParens: SBPO_ControlStatements
SBPO_ControlStatements: false
SpaceInEmptyParentheses: true
SpacesBeforeTrailingComments: true
SpacesInAngles: true
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 2
UseTab: UT_Always