-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from ikbuibui/clangFormat
Run clang-format on repository
- Loading branch information
Showing
94 changed files
with
6,694 additions
and
6,538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
--- | ||
# General options | ||
Language: Cpp | ||
Standard: c++17 | ||
DisableFormat: false | ||
|
||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: AlwaysBreak | ||
AlignArrayOfStructures: None | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveBitFields: false | ||
AlignConsecutiveDeclarations: false | ||
AlignConsecutiveMacros: false | ||
AlignEscapedNewlines: Right | ||
AlignOperands: Align | ||
AlignTrailingComments: | ||
Kind: Never | ||
AllowAllArgumentsOnNextLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Never | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortEnumsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BitFieldColonSpacing: Both | ||
BreakAfterAttributes: Never | ||
BreakBeforeBinaryOperators: All | ||
BreakBeforeBraces: Allman | ||
BreakBeforeConceptDeclarations: Always | ||
BreakBeforeInlineASMColon: OnlyMultiline | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: BeforeComma | ||
BreakInheritanceList: BeforeComma | ||
BreakStringLiterals: true | ||
ColumnLimit: 119 | ||
CommentPragmas: '^ COMMENT pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false | ||
EmptyLineAfterAccessModifier: Never | ||
EmptyLineBeforeAccessModifier: Always | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
IncludeBlocks: Regroup | ||
IncludeIsMainRegex: '(Test)?$' | ||
IncludeIsMainSourceRegex: '' | ||
IndentAccessModifiers: false | ||
IndentCaseBlocks: true | ||
IndentCaseLabels: false | ||
IndentExternBlock: AfterExternBlock | ||
IndentGotoLabels: true | ||
IndentPPDirectives: AfterHash | ||
IndentRequiresClause: false | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: false | ||
InsertBraces: false | ||
InsertNewlineAtEOF: true | ||
IntegerLiteralSeparator: | ||
Binary: 4 | ||
Decimal: 3 | ||
DecimalMinDigits: 7 | ||
Hex: 4 | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
LambdaBodyIndentation: Signature | ||
LineEnding: DeriveLF | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 2 | ||
NamespaceIndentation: All | ||
PackConstructorInitializers: CurrentLine | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakOpenParenthesis: 0 # default made explicit here | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakTemplateDeclaration: 10 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyIndentedWhitespace: 0 # default made explicit here | ||
PenaltyReturnTypeOnItsOwnLine: 1000 | ||
PointerAlignment: Left | ||
PPIndentWidth: -1 # follow IndentWidth | ||
QualifierAlignment: Custom | ||
QualifierOrder: ['friend', 'static', 'inline', 'constexpr', 'type', 'const', 'volatile', 'restrict'] | ||
ReferenceAlignment: Pointer # follow PointerAlignment | ||
ReflowComments: true | ||
RemoveBracesLLVM: false | ||
RemoveSemicolon: false | ||
RequiresClausePosition: WithPreceding | ||
RequiresExpressionIndentation: OuterScope | ||
ShortNamespaceLines: 0 | ||
SortIncludes: true | ||
SortUsingDeclarations: Lexicographic | ||
SeparateDefinitionBlocks: Always | ||
SpaceAfterCStyleCast: true | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: false | ||
SpaceAroundPointerQualifiers: Default # follow PointerAlignment | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCaseColon: false | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: Never | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceBeforeSquareBrackets: false | ||
SpaceInEmptyBlock: false | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInConditionalStatement: false | ||
SpacesInContainerLiterals: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInLineCommentPrefix: | ||
Minimum: 1 | ||
Maximum: -1 | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
TabWidth: 4 | ||
UseCRLF: false | ||
UseTab: Never | ||
|
||
# Project specific options -- uncomment and modify as needed | ||
#AttributeMacros: [] | ||
#ForEachMacros: [] | ||
#IfMacros: [] | ||
IncludeCategories: | ||
# Local headers (in "") above all else | ||
- Regex: '"([A-Za-z0-9.\/-_])+"' | ||
Priority: 1 | ||
# "redGrapes/foo.hpp" after local headers (occur inside redGrapes) | ||
- Regex: '"redGrapes/([A-Za-z0-9.\/-_])+"' | ||
Priority: 2 | ||
# <redGrapes/foo.hpp> after local headers (occur outside redGrapes in examples and test) | ||
- Regex: '<redGrapes/([A-Za-z0-9.\/-_])+>' | ||
Priority: 3 | ||
# C++ standard library headers are the last group to be included | ||
- Regex: '<([A-Za-z0-9\/-_])+>' | ||
Priority: 5 | ||
# Includes that made it this far are third-party headers and will be placed | ||
# below redGrapes's includes | ||
- Regex: '<([A-Za-z0-9.\/-_])+>' | ||
Priority: 4 | ||
# Macros: [] | ||
#NamespaceMacros: [] | ||
#StatementAttributeLikeMacros: [] | ||
#StatementMacros: [] | ||
#TypenameMacros: [] | ||
#WhitespaceSensitiveMacros: [] | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
############ | ||
Contributing | ||
############ | ||
|
||
Formatting | ||
========== | ||
|
||
Please format your code before before opening pull requests using clang-format 16 and the .clang-format file placed in the repository root. | ||
|
||
Visual Studio and CLion | ||
----------------------- | ||
|
||
Suport for clang-format is built-in since Visual Studio 2017 15.7 and CLion 2019.1. | ||
The .clang-format file in the repository will be automatically detected and formatting is done as you type, or triggered when pressing the format hotkey. | ||
|
||
Bash | ||
---- | ||
|
||
First install clang-format-16. Instructions therefore can be found on the web. | ||
To format your changes since branching off develop, you can run this command in bash: | ||
|
||
.. code-block:: bash | ||
git clang-format-16 develop | ||
To format all code in your working copy, you can run this command in bash: | ||
|
||
.. code-block:: bash | ||
find -iname '*.cpp' -o -iname '*.hpp' | xargs clang-format-16 -i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.