AlabamaASRL / asset_asrl

https://alabamaasrl.github.io/asset_asrl/
Apache License 2.0
29 stars 6 forks source link

Formatting and Style #27

Closed wgledbetter closed 1 year ago

wgledbetter commented 1 year ago

In my opinion, we have to have some kind of consistent formatting and style in order to be taken seriously. I have a .clang-format configuration that I like (posted below). We don't have to use that, but I really do think we need something.

---
BasedOnStyle: Google
SortIncludes: true
ColumnLimit: 110

################################################################################

AccessModifierOffset: -1
AlignAfterOpenBracket: Align
# AlignArrayOfStructures: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
# BreakInheritanceList: AfterComma
BreakStringLiterals: true
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
# EmptyLineAfterAccessModifier: Leave
# EmptyLineBeforeAccessModifier: Always
FixNamespaceComments: true
IncludeBlocks: Regroup
# IndentAccessModifiers: true
IndentCaseBlocks: false
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
# IndentRequires: true
IndentWidth: 2
IndentWrappedFunctionNames: true
# InsertTrailingCommas: true
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
# PPIndentWidth: -1
# PackConstructorInitializers: NextLine
PointerAlignment: Left
# QualifierAlignment: Left
# QualifierOrder: ['inline', 'static', 'type', 'const', 'volatile']
# ReferenceAlignment: Pointer
ReflowComments: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
# SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
# SpacesInLineCommentPrefix:
#   Minimum: 1
#   Maximum: 1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
TabWidth: 4
UseCRLF: false
UseTab: Never
jbpezent commented 1 year ago

@wgledbetter Agreed. We'll apply the above formatting after the vectorize-integrators branch is merged to master to prevent a bunch of merge conflicts.