#
# aGrUM clang-format specification (version clang-format-11)
# Pierre-Henri Wuillemin - 2016-2021
#
BasedOnStyle: LLVM

Standard: c++20

ColumnLimit: 100
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: false
ReflowComments: true
CommentPragmas: "\\@headerfile"

IndentPPDirectives: AfterHash
BreakBeforeBraces: Attach
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBinaryOperators: All
BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakStringLiterals: true
BreakConstructorInitializers: AfterColon
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakAfterReturnType: None
BreakInheritanceList: AfterColon

CompactNamespaces: false
FixNamespaceComments: true

IndentWidth: 2
ContinuationIndentWidth: 3
UseTab: Never
AccessModifierOffset: 0
IndentCaseLabels: true
IndentWrappedFunctionNames: true
NamespaceIndentation: All

SpacesInAngles: true
Cpp11BracedListStyle: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceAfterCStyleCast: false
SpacesInCStyleCastParentheses: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 3
SpacesInContainerLiterals: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeCpp11BracedList: false
SpaceAfterLogicalNot: false


PointerAlignment: Left
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveMacros: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignOperands: AlignAfterOperator

AlignTrailingComments: true

AllowAllParametersOfDeclarationOnNextLine: false
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AlignEscapedNewlines: Left

BinPackArguments: false
BinPackParameters: false

AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: false


SortUsingDeclarations: false
SortIncludes: Never
IncludeBlocks: Regroup
# see https://www.regextester.com/
IncludeCategories:
  - Regex:           '<agrum\/[[:alnum:]|\/]+\.h>'
    Priority:        1
  - Regex:           '<[[:alnum:].]+>'
    Priority:        2
  - Regex:           '"[^.]+\.h"'
    Priority:        3
