Commit 8fe42476 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Merge branch 'add-clang-format' into 'main'

Add .clang-format file to the repo

See merge request !14
parents 5e07e089 12c02243
Loading
Loading
Loading
Loading

.clang-format

0 → 100644
+205 −0
Original line number Diff line number Diff line
---
BasedOnStyle: LLVM
Language: Cpp

##############################################################
### ALIGN ....
AlignTrailingComments:
  Kind: Always
  OverEmptyLines: 2

###############################################################
#### ALLOW ALL ... IN ... LINE
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: Empty  # Ensure functions aren't packed

###############################################################
#### BIN PACK ...
BinPackArguments: false
BinPackParameters: false
PackConstructorInitializers: NextLine
PenaltyBreakBeforeFirstCallParameter: 0  # Forces breaking the parameters onto multiple lines

###############################################################
#### COLUMN WIDTH
ColumnLimit: 79  # More strict column limit to avoid argument packing

###############################################################
#### TABS ...
UseTab: Never
TabWidth: 4
IndentWidth: 4
...

# ############################################################################
# ####### OPTIONS IN CASE CLANG-FORMAT NEEDS MODIFICATION
# ############################################################################
# ##############################################################
# ### ALIGN ....
# AlignAfterOpenBracket: BlockIndent
# AlignArrayOfStructures: Right
# AlignConsecutiveBitFields:
#   Enabled: true
#   AcrossEmptyLines: true
#   AcrossComments: true
#   AlignCompound: true
#   AlignFunctionPointers: true
#   PadOperators: true
# AlignEscapedNewlines: Left
# AlignOperands: AlignAfterOperator

# ###############################################################
# #### ALLOW ALL ... IN ... LINE
# AllowAllArgumentsOnNextLine: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowShortBlocksOnASingleLine: Empty
# AllowShortCaseLabelsOnASingleLine: true
# AllowShortCompoundRequirementOnASingleLine: true
# AllowShortEnumsOnASingleLine: true
# AllowShortFunctionsOnASingleLine: All
# AllowShortIfStatementsOnASingleLine: AllIfsAndElse
# AllowShortLambdasOnASingleLine: All
# AllowShortLoopsOnASingleLine: false

# ###############################################################
# #### ALWAYS BREAK ...
# AlwaysBreakBeforeMultilineStrings: true
# AlwaysBreakAfterReturnType: None
# AlwaysBreakTemplateDeclarations: MultiLine


# ###############################################################
# #### BRACED INITIALIZER INDENT WIDTH
# BracedInitializerIndentWidth: 4

# ###############################################################
# #### BREAK BEFORE ...
# BreakBeforeBraces: Custom ############################ THIS ONE IS IMPORTANT
# BraceWrapping:
#   AfterCaseLabel: false
#   AfterClass: false
#   AfterControlStatement: MultiLine
#   AfterEnum: false
#   AfterFunction: false
#   AfterNamespace: false
#   AfterStruct: false
#   AfterUnion: false
#   AfterExternBlock: false
#   BeforeCatch: false
#   BeforeElse: false
#   BeforeLambdaBody: false
#   IndentBraces: false
#   SplitEmptyFunction: false
#   SplitEmptyRecord: false

# BreakBeforeBinaryOperators: NonAssignment
# BreakStringLiterals: true
# BreakInheritanceList: BeforeComma
# BreakConstructorInitializers: AfterColon
# BreakBeforeTernaryOperators: true
# BreakBeforeInlineASMColon: OnlyMultiline
# BreakBeforeConceptDeclarations: Allowed
# BreakArrays: false
# BreakAfterAttributes: Never
# BreakAdjacentStringLiterals: true


# ###############################################################
# #### MISC
# CompactNamespaces: true
# ConstructorInitializerIndentWidth: 4
# ContinuationIndentWidth: 4
# Cpp11BracedListStyle: true
# DerivePointerAlignment: false
# DisableFormat: false

# ###############################################################
# #### ACCESS MODIFIER
# EmptyLineAfterAccessModifier: Never
# EmptyLineBeforeAccessModifier: Always

# ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: true
# IncludeBlocks: Preserve

# ###############################################################
# #### INDENT ...
# IndentAccessModifiers: false
# IndentCaseBlocks: false
# IndentCaseLabels: true
# IndentExternBlock: NoIndent
# IndentGotoLabels: false
# IndentPPDirectives: None
# IndentRequiresClause: false
# IndentWidth: 4
# IndentWrappedFunctionNames: true
# InsertBraces: true
# InsertNewlineAtEOF: true
# InsertTrailingCommas: Wrapped
# IntegerLiteralSeparator:
#   Binary: 4
#   Decimal: 3
#   Hex: 4
# LambdaBodyIndentation: Signature
# KeepEmptyLinesAtTheStartOfBlocks: false
# KeepEmptyLinesAtEOF: false
# Language: Cpp
# MaxEmptyLinesToKeep: 3
# NamespaceIndentation: None
# PPIndentWidth: 1
# PackConstructorInitializers: Never
# PointerAlignment: Right
# QualifierAlignment: Left
# ReferenceAlignment: Right
# ReflowComments: true
# RemoveBracesLLVM: false
# RemoveParentheses: MultipleParentheses
# RemoveSemicolon: true
# RequiresClausePosition: WithPreceding
# RequiresExpressionIndentation: OuterScope
# SeparateDefinitionBlocks: Always
# ShortNamespaceLines: 4
# SkipMacroDefinitionBody: false
# SortIncludes: CaseSensitive
# SortUsingDeclarations: LexicographicNumeric

# ###############################################################
# #### SPACE BEFORE / AFTER ...
# SpaceAfterCStyleCast: true
# SpaceAfterTemplateKeyword: false
# SpaceAfterLogicalNot: true
# SpaceAroundPointerQualifiers: After
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: true
# SpaceBeforeCpp11BracedList: true
# SpaceBeforeCtorInitializerColon: false
# SpaceBeforeInheritanceColon: false
# SpaceBeforeParensOptions:
#   AfterControlStatements: false
#   AfterForeachMacros: false
#   AfterFunctionDeclarationName: false
#   AfterFunctionDefinitionName: false
#   AfterIfMacros: false
#   AfterOverloadedOperator: false
#   AfterPlacementOperator: true
#   AfterRequiresInClause: false
#   AfterRequiresInExpression: false
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceBeforeSquareBrackets: false
# SpaceInEmptyBlock: false
# SpacesBeforeTrailingComments: 2
# SpacesInAngles: Never
# SpacesInContainerLiterals: false
# SpacesInLineCommentPrefix:
#   Minimum: 1
#   Maximum: -1
# SpacesInParensOptions:
#   InCStyleCasts: false
#   InEmptyParentheses: true
#   InConditionalStatements: true
#   Other: false
# SpacesInSquareBrackets: false
# Standard: Auto